3 Replies Latest reply on Feb 7, 2017 8:15 PM by Nipun Garg

    Display YOY Difference -% Difference

    Teresa Wright

      My worksheet lists compensation for multiple years (2014-2016), and I have a problem displaying data for measures with no prior year data (only 2016).  In these instances, I would like to display a YOY % difference of 100% and display a difference equal to 2016 data.  Sorry I cannot share a workbook due to work restrictions.

       

      screenshot 1.jpg

       

      When I try setting a table calculation on SUM(Compensation) to Difference or Percent Difference, I get a blank field with no results.

       

      What am I doing wrong?

       

      screenshot 2.jpg     screenshot 3.jpg

        • 1. Re: Display YOY Difference -% Difference
          Sherzodbek Ibragimov

          Teresa,

          Would be nice if you could still post some sample reflecting the structure of your actual data: Anonymize your Tableau Package Data for Sharing

          • 2. Re: Display YOY Difference -% Difference
            Khang Pho

            Hi Teresa,

             

            The problem is that the table calculation looks at the value before it.  Note that there is a difference between a 0,null, and the datapoint just never existing.  If no data exist what you need to do is pad your data aka put values in your raw data that is either 0 or null for all measures you plan on comparing for all dates.  That way when you do the calculation it will give you the 100% you are looking for since it can compare the change from 0 to $2,691.

             

            Regards,

             

            Khang

            • 3. Re: Display YOY Difference -% Difference
              Nipun Garg

              HI Teresa

              Your problem is related to the filter .

              When you use table calculation you should consider that the table calculation are applied after the  filter is applied to your data.

              So when you apply Table calculation to check the % difference to previous year but your data not contained any previous year as it is filtered by you.

              To get the desired result you should modify your year calculation and make a calculated field which is a table calculation as the filter of a table calculation field is applied after your calculation field is computed.In simple words a table calculation field filter just hide the data not filtered it out and you get your desired result.

              Make a calculation field like something: Str(Lookup(Max(year([Statement Month Year])),0))

              Please check the spelling of field as i dont have the data .

              Hope it will help you.