In my Timecard App, I want to have a table view that will show total hours worked up to that point, for each individual employee.
So, if on Thursday morning I check to see the total hours up to that point for each employee, I will see a table of all the employees and their hours worked each day. The Group Aggregate for that view would show the total hours worked.
It would look like this:
I used the Total Hours expression from the article below and it yielded my Total Hours worked through today, which is what I want. How can I expand this to include all employees? Any sttrategies to make this work? Thank you, all.
If you calculate the duration with the TOTALHOURS() in another column, you could then use the aggregate with the sum employee by employee.
Aleksi, does this have to be a column in the actual spreadsheet or can it be a virtual column?
Also, here is the expression I’m using. It yields my total hours, but how can I modify this so that it captures each employee?:
TOTALHOURS(
SUM(
SELECT(
Timecards[Total Hours],
AND(
([Employee Email] = USEREMAIL()),
(DATE([Time In]) > (TODAY() - WEEKDAY(TODAY()))),
(DATE([Time In]) <= (TODAY() - WEEKDAY(TODAY())) + 7)
)
)
)
)
Thank you.
It can be either normal or virtual because the result is coming just from this one record. I would use normal.
TOTALHOURS(
SUM(
SELECT(
Timecards[Total Hours],
AND(
(DATE([Time In]) > (TODAY() - WEEKDAY(TODAY()))),
(DATE([Time In]) <= (TODAY() - WEEKDAY(TODAY())) + 7)
)
)
)
)
Ok, so I added a normal column to my spreadsheet and named it “Hours To Date.” I entered the suggested expression to this column’s App Formula.
I then made a new timecard entry and the result of the expression in this new timecard’s “Hours To Date” column, is the sum of all Total Hours for this week.
Which, I believe, makes sense since the expression makes no distinction between employees; the expression is simply selecting total hours within the date range and summing these up, right?
When I choose 'SUM: Hours To Date" from the “Group Aggregate” view option, I’m seeing these inflated numbers and not individual hours to date.
I took a wrong turn somewhere… What am I missing?
User | Count |
---|---|
35 | |
30 | |
30 | |
20 | |
18 |