2 Replies Latest reply on Apr 18, 2013 3:57 AM by buildstar

    Subtract Row Values - Tableau 8

    buildstar

      Hi All,

       

      As attached in the screen ch and cl are dropdowns in a report.

       

      Now in the que column I need to do the following computation

       

      (4706373-16528007)-1 and display in a new column  next to mque column as a percentage value.

       

      For this example the value to be displayed is -71.52%

       

      So this must be displayed in the new column.

       

      Similarly, (84626-301705)-1 = -71.95% needs to be displayed in the column.

       

      Also I may want to compute same formula for mque and display result next to the new column.

       

      Please help with a formula and solution

       

      Thanks in advance

        • 1. Re: Subtract Row Values - Tableau 8
          Tracy Rodgers

          Hi Gallop,

           

          Creating a calculated field similar to the following should get the desired outcome:

           

          ((lookup(sum([que]), first()+1)-lookup(sum([que]), first()))-1)/(lookup(sum([que]), first()+1))

           

          Once it is placed on the view, right click on it and select Compute using...>ch.

           

          Hope this helps!

           

          -Tracy

          • 2. Re: Subtract Row Values - Tableau 8
            buildstar

            Hi Tracy,

             

            Thanks for the reply.

             

            The percentage values are now matching. There are 3 issues that I am trying to fix:

             

            1.) The percentages must be displayed next to only one row of data in the column as attached image

             

            2.) Sometimes the data does not load based on ch column and hence es column is the be used for computation.

             

            3.) We may have only data for 3 rows and is such cases the computation is to be performed based on the es values. Now blank data is shown.

             

            Have attached the images in this reply

             

            Please help fix these and let me know on any details if required.