1 Reply Latest reply on Oct 29, 2018 8:41 AM by Joshua Milligan

    DateDiff Calculation Issue When Cleaning Data

    Adam Ciampaglio

      Working in tableau prep I am getting a Input Node Failure error code and I have narrowed it down to this calculation:

       

      (ABS

       

      (IF ([Year]=#2016-01-01#) AND NOT ISNULL([date_registration]) THEN DATEDIFF('year',#2016-11-08#,[date_registration])

      ELSEIF ([Year]=#2016-01-01#) AND ISNULL ([date_registration]) THEN DATEDIFF('year',#2016-11-08#,[Registration Date])

       

      ELSEIF ([Year]=#2014-01-01#) AND NOT ISNULL([date_registration]) THEN DATEDIFF('year',#2014-11-04#,[date_registration])

      ELSEIF ([Year]=#2014-01-01#) AND ISNULL ([date_registration]) THEN DATEDIFF('year',#2014-11-04#,[Registration Date])

       

      ELSEIF ([Year]=#2018-01-01#) AND NOT ISNULL([date_registration]) THEN DATEDIFF('year',#2018-11-06#,[date_registration])

      ELSEIF ([Year]=#2018-01-01#) AND ISNULL ([date_registration]) THEN DATEDIFF('year',#2018-11-06#,[Registration Date])

       

      END))

       

      Specifically i have narrowed it down to the lines that are bolded, as it exports to an extract without them. Past this I have not been able to narrow it down from there.

       

      The basis of the idea of the calc is that there are two fields that have a registration date (date_registration and Registration Date) and we want to query date_registration first for the calc but if it is null then query Registration Date.