Skip to main content

Working in Tableau Prep 2018.2 (company is planning an updgrade soon).

 

I am trying to calculate DateDiff when certain fields in my data set meet criteria. After creating and IF/THEN with a DateDiff formula, I continue to run into issues where the field does not appropriately calculate and/or the results are blank. See attached screenshots, workflow, and data.

2 answers
  1. Mar 10, 2020, 5:15 PM

    When I open your flow, I immediately see the following error:

    When I open your flow, I immediately see the following error: Your DATEDIFF calculation in the existing calc needs to change

     

    Your DATEDIFF calculation in the existing calc needs to change "days" to "day".

     

    IF [Recommendation State] = "Open"

    THEN DATEDIFF('day',[Estimated Implementation Date],TODAY())

    ELSE DATEDIFF('day',[Actual Implementation Date],TODAY())

    END

     

    But onto your actual question, try the following and it should return results:

     

    IF ISNULL([Actual Implementation Date]) THEN

         DATEDIFF('day',[Estimated Implementation Date],TODAY())

    ELSE

         DATEDIFF('day',[Actual Implementation Date],TODAY())

    END

    pastedImage_3.png

    See attached.

0/9000