Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

two dates comparison with +- comparision

I have two Date fields as below
 
ACTUAL_DATEPREDICTION_DATESTATUS
10/30/2020nullNO_RESULT
10/28/2020nullNO_RESULT
10/8/202010/9/2020TRUE
10/10/202010/9/2020TRUE
10/15/202010/9/2020FALSE

 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

  • Anonymous , Try a new column like


    Switch( True(),
    isblank([PREDICTION_DATE]) ,"NO_RESULT",
    abs(datediff([ACTUAL_DATE],[PREDICTION_DATE],day))<=2, "TRUE",
    "FALSE"
    )