5 Replies Latest reply on Nov 11, 2018 3:56 PM by Shinichiro Murakami

    How could I calculate a Percentage difference between two Dimensions?

    Alan Gutierrez

      Issue Description:

       

      I've a problem by using a dimension that I've already created using the FIXED property.

       

      To I would classify a records of different sites on "FIXED" and "EVENTUAL" I use the next calculated field.

       

      IF {FIXED [Id Sitio]:SUM(IF [Sub Cost] = "Electricidad" THEN 1 ELSE 0 END)} >= 1 AND {FIXED [Id Sitio]:SUM(IF [Sub Cost] = "Diesel" THEN 1 ELSE 0 END)}>=4 THEN "FIXED" ELSE "EVENTUAL" END

       

      FORMULE.PNG

      Last formule meets with a classification exactly that I wanted. So I got the next with te new Dimension:

       

      clasify.PNG

      But, I need to add a row with a percentage difference between the "Eventual" Column value and the "Fixed" Column Value, So I tried with a formula by using LookUp Property as I've shown below.

       

      LOOKUP(SUM([Cost]),0)/LOOKUP(SUM([Cost]),LAST())

       

      It didn't works actually due to It shows me up two results. One of them is exactly that I wanted (56%) but the other one is completely wrong. I just want a difference between "Eventual" row and "FIXED" Row

       

      worng.PNG

       

      I really hope someone could give me a hand with this. Thanks for reading.

       

      By the way I didn't attach the input and tableau file as package because is bigger than the forum limits.