1 Reply Latest reply on Jan 7, 2019 3:39 PM by Patrick Van Der Hyde

    Calculation within dimension


      Hi all,


      I have a dimension called "Aba_Code" that includes various Codes from 30 through 90.


      If I drag "Aba_Code" in rows and Sum[sales] I get the following:


      AbaCode, Sales

      30, 1500

      31, 2500


      90, 3000


      I want to create various new rows with a number of different calculations such as:

      31-30 = (2500 -1500) = 1000 or 90 - 31, etc.


      Then the above would look like:                 

      30, 1500

      31, 2500

      31-30, 1000


      90, 3000

      90-31, 500


      Is this possible?




        • 1. Re: Calculation within dimension
          Patrick Van Der Hyde

          Hello Alex,


          You could utilize Lookup() functions to do this sort of thing and even make it somewhat interactive by use of a Parameter but you would still be doing one field at a time and the results would not be new rows in the data.  If you need the actual data to have new rows then I suggest making the changes outside of Tableau before bringing them in to Tableau.  Tableau does not interact with original source data to make changes to the data. 


          I hope this helps.