Show days per week as percentage out of totals

Hi all,

thanks for the help in advance!
I have a dataset with absence data from employees with dates and a code of the day. The code describes the absence type like sick, vacation etc.

i have splitted that into a calculated fied (Daily_absence) to see the absence per working day with that ifelse:
ifelse(
extract(‘WD’, Date) = 2, ‘1_Monday’,
extract(‘WD’, Date) = 3, ‘2_Tuesday’,
extract(‘WD’, Date) = 4, ‘3_Wednesday’,
extract(‘WD’, Date) = 5, ‘4_Thursday’,
extract(‘WD’, Date) = 6, ‘5_Friday’,
extract(‘WD’, Date) = 7, ‘6_Saturday’,
‘’
)

However, by doing so im not able to calculate the percentage out of the total absence + present times as it also splits these automatically.

So what im looking for is how to calculate:

Monday absence / total absence+total present
Tuesday absence / total absence+total present

ive tried Sumover but this didnt solved it or im doing something wrong.

Hello @David_Goumah

Can you share your sumOver calculation?

To me it sounds like you need to count the absence days then divide by total working days. Something like this:

sumOver(ifelse(Daily_absence = '1_Monday',1,0),[ ], PRE_AGG/sumOver(count_of_working_days, [ ], PRE_AGG)

Hey Duncan, thx for the hint this solved my problem:

{unexpected_absence} / sumOver({total_days_counted},[emplid],POST_AGG_FILTER)

1 Like