Hi,
I have a spreadsheet with 40k rows or so which is added onto every week. Each row has an Employee ID, Employee’s Shift Number and Hours worked column (see attached image for sample data).
The problem is that I have the work out the Hours worked from a database to which I have an ODBC link setup to using SQL (The query would be something as follows:
My first instinct was to import the whole database table using Power Query into a separate worksheet and then use a 2 criteria index and match to find the house worked. The problem with this is that the database table has about 400k records (and increasing) so this approach is not efficient at all and is extremely slow since I end up using an array formula to lookup as well.
Is there a better, more efficient way of doing this so that the hours worked column is populated using the criteria above?
Many thanks in advance for your time and help!
I have a spreadsheet with 40k rows or so which is added onto every week. Each row has an Employee ID, Employee’s Shift Number and Hours worked column (see attached image for sample data).
The problem is that I have the work out the Hours worked from a database to which I have an ODBC link setup to using SQL (The query would be something as follows:
SQL:
SELECT hours_worked FROM employee_hrs WHERE employee_id = <employee id in excel> and shift_no = <Shift Number in excel>
My first instinct was to import the whole database table using Power Query into a separate worksheet and then use a 2 criteria index and match to find the house worked. The problem with this is that the database table has about 400k records (and increasing) so this approach is not efficient at all and is extremely slow since I end up using an array formula to lookup as well.
Is there a better, more efficient way of doing this so that the hours worked column is populated using the criteria above?
Many thanks in advance for your time and help!