I’ve a peculiar requirement where I need to calculate consecutive working days for employees.
Info I’ve is:
Employee, Calendar Day. Calendar day is only populated when the employee goes to work. If not it is blank.
Based on calendar day … if an employee worked consecutive days, I need to count each day as 1 and sum up to get number of days consecutively worked in a month.
You might be able to do this using the Previous() function and then checking whether the date you have is only one day away from the Previous() value in that dimension and then setting a flag to 1, then adding up the flags.
Pseudo
=If(DaysBetween([Date];Previous([Date])=-1) Then 1 Else 0
That wasnt an actual formula to use it was some pseudo code to give you an idea of how you might start achieving this with the previous function. Youll have to experiment.
you 100% correct. If we use RunningCount. we need to have reset counter.
But I don’t think calendar day can be used as reset. If can, please let me know the formula for reset_dims as I tried and it is not working.
If we you running count… system is taking from 1st line and continuously populating the counter.
Sorry Nelson.
I was thinking that if I could get the solution which you have provided then I could calculate later. But after your excellent solution, my requirement is quite complex which cannot be done @ webi level.