2 Replies Latest reply on May 2, 2016 6:15 AM by Jung Jein

    Identifying the record that resulted in the difference

    Jung Jein

      Hi,

       

      Say I have a list of companies from each state and their profits for the year.

       

      Original dataset:

      CompanyStateProfitYear
      AWA2002012
      AWA2502013
      AWA2002014
      BTN1502012
      BTN02013
      BTN3002014
      CTN1502012
      CTN1502013
      CTN3002014
      DCA1502012
      DCA1502013
      DCA1502014
      ETN2002012
      ETN2002013
      ETN2002014

       

      How can I find the top company that caused the largest year-on-year change (positive or negative) in total profits?

      For e.g. in TN, the main cause of the changes in profits in 2013 is Company B

       

      Total Profit
      State2012
      20132014
      WA200250200
      TN500350800
      CA150150150

       

      Thanks in advance!

        • 1. Re: Identifying the record that resulted in the difference
          Tableau kumar

          1) Drag the filelds as below [State], [Year] on to Rows shelf, [Profits] onto "Text" labels.

          2) Now Right click on [Profits] then click on "Add Table Calculation".

          3) Calculation Type: "Difference from",

          Calculate the Difference along: "Panbe Down"

          Display the values as Diffewrence from "Previous".

          4) Now we are getting the Sales Difference fromm Previous Year for Each State Individually

          5) Drag the Sales from Mark Window to Measures window then automatically create a field.

          6) Now we can create a new field using the above calculated as below

          Name: Variance

          Syntax: if [Differe from Previous] >=0 then "Green" ellse "Red" end.

          7) Now drag the Above Calculated field on to Colors shelf then assign the colors accordingly.

           

          Best Regards

          Kumar

          • 2. Re: Identifying the record that resulted in the difference
            Jung Jein

            Appreciate your help, but do you know how I can display the [Company] that caused the largest Sales difference?

             

            Thanks in advance Kumar!