Forum Discussion
Anonymous
5 years agoNot applicable
two dates comparison with +- comparision
I have two Date fields as below
| ACTUAL_DATE | PREDICTION_DATE | STATUS |
| 10/30/2020 | null | NO_RESULT |
| 10/28/2020 | null | NO_RESULT |
| 10/8/2020 | 10/9/2020 | TRUE |
| 10/10/2020 | 10/9/2020 | TRUE |
| 10/15/2020 | 10/9/2020 | FALSE |
i wanted to have a calculated column(STATUS) which would display true if actual date is +- 2 days from PRED_POD_TS
And display NO val if PREDICTION_DATE is null
for example
1) actual date is 8th Oct and PREDICTION_DATE is 9th OCT then display column as true
2) actual date is 10th Oct and PREDICTION_DATE is 9th OCT then display column as true
3)actual date is 15th Oct and PREDICTION_DATE is 9th OCT then display column as False
is this possible?
Anonymous , Try a new column like
Switch( True(),
isblank([PREDICTION_DATE]) ,"NO_RESULT",
abs(datediff([ACTUAL_DATE],[PREDICTION_DATE],day))<=2, "TRUE",
"FALSE"
)
1 Reply
- amitchandakSuper User
Anonymous , Try a new column like
Switch( True(),
isblank([PREDICTION_DATE]) ,"NO_RESULT",
abs(datediff([ACTUAL_DATE],[PREDICTION_DATE],day))<=2, "TRUE",
"FALSE"
)