7 Replies Latest reply on Nov 12, 2018 11:29 PM by ghadijah du Toit

    Calculation

    ghadijah du Toit

      hi All,

       

      I am trying to calculate the below, when I test the first if statement calculates correctly, however within tableau the second part of the calculation just brings up zero.Attached is the work book

       

      Could anyone please assist ?

       

      { FIXED [Metric Name]:

      COUNTD(

      IF   (STR([Target Upper or Lower check])) = '0'

       

      THEN


      IF (FLOAT([KPI Value])) >= (FLOAT([Target1])) THEN ([Metric Name]) 

       

      ELSE

      IF  (STR([Target Upper or Lower check])) = '1'

      THEN
              IF (FLOAT([KPI Value])) <= (FLOAT([Target1])) THEN ([Metric Name]) ELSE NULL END

      ELSE NULL END

      END

      END)

      }