cartercjb
01-19-2022ETL
CONDITIONAL CASE SUM
Hi Sisense Community!!
Please reference the attached workbook that I drafted in Excel. I am trying to draft a daily view by week, of each employee's time worked. This screenshot shows an example of actual hours worked by day by employee.
I am trying to create a dynamic case statement for a metric that calculates the same way as is seen in K7 in the workbook. Essentially it would ready like this:
SUM(TIME ON SUNDAY)
+ IF (TIME ON MONDAY = 0 THEN 0 ELSE TIME ON MONDAY)
+ IF(TIME ON TUESDAY = 0 THEN 0 ELSE TIME ON TUESDAY)
+ IF(TIME ON WEDNESDAY = 0 THEN 0 ELSE TIME ON WEDNESDAY)
+ IF(TIME ON THURSDAY = 0 THEN 0 ELSE TIME ON THURSDAY)
+ IF(TIME ON FRIDAY = 0 THEN 0 ELSE TIME ON FRIDAY)
Any suggestions on how to get this case statement started through the first two lines?
Many thanks in advance!
-Carter
oops.. I missed the keyword 'THEN'.
Here is the updated formula (added 'THEN' before second CASE statement)
sum([Day Of Week], case when max([Day Of Week]) = 1 then sum([Employee Regular Paid]) when max([Day Of Week]) < 7 then (case when sum([Employee Regular Paid])= 0 then 8 else sum([Employee Regular Paid]) end) end)