Forum Discussion

cartercjb's avatar
01-19-2022
Solved

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 o...
  • harikm007's avatar
    harikm007
    01-20-2022

    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)