Hello Folks,
I'm attempting to come up with a calculation that counts # of safe days FROM the last non-safe day.
So in the example below, our last safety incident was on 11/11/2018. So I need to count the number of 1's from the most recent safety incident up until the current date (TODAY)
I'm assuming this is a FIXED LOD, but maybe not...
COUNT({FIXED [Date]:MAX(IF [Safe Day]=0 THEN... start counting up until today.
Any guidance would be much appreciated. Thanks!
Start with an LOD to give you the last non-safe day:
Last Non-Safe Day
{FIXED : MAX(IIF([Safe Day]=0, [Date], NULL))}
Then an LOD to give you the latest date in the data set
Last Day
{FIXED : MAX([Date])}
Then a calc to find the difference.
Safe Days
DATEDIFF('day', [Last Non-Safe Day], [Last Day])
See attached sample workbook.