Weekly hours by Customer ID

I have columns Customer ID, Job ID, Job Date, Job duration. I also calculated a column for which WEEKNUM the job falls in. How can I pull out the total hours for all jobs each week by Customer ID?

0 5 101
5 REPLIES 5

That works. Hereโ€™s what I used for each week.
=QUERY(Jobs!1:1000, โ€œSELECT B,C,D,J,K, SUM(L) WHERE G = 37.00 GROUP BY B,C,D,J,Kโ€,1)

That looks to me like an sheets or excel formula, you might want to try to keep most of the operations inside of your app, since it can affect performance, especially if you have complex formulas for each row on lenghty tables, that can absolutely murder your sync times.

But if youโ€™re gonna go with that, let me give you a couple tips:

If youโ€™re gonna have a formula for each row, always start with a IF(A1<>"",(your formula),) so that the sheet checks if it is a blank row first before it calculates anything else, this can really save you a loooot of performance issues.

If there are a lot of jobs then eventually 1:1000 wonโ€™t be enough, i suggest using something like Jobs!A:D for example, that will take into consideration new rows.

Youโ€™re right. I started directly in the sheet to see if it worked but appsheet does not like QUERY. Is this formula possible, maybe using a slice?

Of course, @Marc_Dillon linked a few interesting articles, i recommend you start there, after that you should have an idea of how to put together your expression or at least with which function to start with, weโ€™ll be here to answer any specific questions.

Or if you need help getting the exact expression, it is often required that you share more information about your app structure, like tables, columns, references, etc.

Top Labels in this Space