
1. Re: Calculate and flag number of days late based on current date
Jim Horbury Sep 17, 2018 2:20 AM (in response to Moses Dhas)Hi. I'm assuming you want to express this logic as a single calculated field? Have you tried something like this (example for the start type calculation)
IF (ISNULL([Start Actual]) AND [Start Forecast] < TODAY())
THEN (
IF DATEDIFF('day',TODAY(),[Start Forecast]) < 7 THEN '07'
ELSEIF DATEDIFF('day',TODAY(),[Start Forecast]) < 14 THEN '814'
ELSE '21+'
END
)
END

2. Re: Calculate and flag number of days late based on current date
Moses Dhas Sep 17, 2018 3:03 AM (in response to Jim Horbury)Thanks for the assist, however the formula returns 0 for everything. i have created a formula (refer attached). based on the formula [Start Fcst (Count)] should i create another one to flag based on number of day if this is the case i will have to do 2 formula for each date type and there are 14 in total.
Formula created
INT(If DATEDIFF('day', TODAY(), [Start Forecast]) <= 0 and ISNULL([Start Actual])= TRUE
Then [Start Forecast]
ELSE
null
END)

tableau 1.PNG 46.8 KB


3. Re: Calculate and flag number of days late based on current date
Jim Horbury Sep 17, 2018 3:29 AM (in response to Moses Dhas)The calculation returns nothing because there are no rows that satisfy the first conditions of your required calculation:
ISNULL([Start Actual]) AND [Start Forecast] < TODAY()
Could this be OR?
Regards your calculation, it depends if you need to display the actual DATEDIFF value or just aggregate the number of rows in each category (07, 814, etc). If it's the latter, then you can handle it in a single calculation.