1 Reply Latest reply on Jun 17, 2016 4:29 AM by Ashish Chaudhari

    Explanation for this formula

    Mila T

      Hi All,

      Can someone explain me this formula from Tableau as I am beginner?

      Thank you in advance.

       

      (ZN(AVG([AAA Ratio])) - LOOKUP(ZN(AVG([AAA Ratio])), -1))*lookup(SUM([Number of Records]),-0)

        • 1. Re: Explanation for this formula
          Ashish Chaudhari

          Hi Mila,

           

          ZN() function is used to convert nulls to 0 for any measure. it is used because if we perform multiplication or division there should not be arithmetic exception.

           

          Talking about below section (partial)

          (ZN(AVG([AAA Ratio])) - LOOKUP(ZN(AVG([AAA Ratio])), -1))

          This will take the Avg AAA ratio and subtract it from the Avg AAA ratio from previous row.

           

          lookup(SUM([Number of Records]),-0)

          After getting above answer it will be multiplied with total number records by each value in dimension. I am not sure why its written as -0. - and 0 I have never seen them together. Correct me if I am wrong.

           

          If possible, please share the sample data I can explain things on it.

           

          -Ashish.