I am trying to calculate the number of days for a project based on the active_flag. If the active flag is true, the number of days should be calculated from the end_day till today. If the active flag is false, the number of days should be calculated from the end_day till the last observation date (ob_date). Below is my attempt:
if active_flag = True then datediff('day',[end_date],TODAY())
elseif active_flag = False then datediff('day',[end_date], max([ob_date])) end
I see the errors so I'm looking for suggestions on how to re-write this calc to get the desired result.