
1. Re: Calculating Year on Year Growth
Russell Christopher May 30, 2012 9:33 AM (in response to Anurag Gulati)Please post an example?

2. Re: Calculating Year on Year Growth
Jonathan Drummey Jun 8, 2012 3:11 AM (in response to Anurag Gulati)Hi Anurag,
Here's an example using the Superstore sales data.
Jonathan

3. Re: Calculating Year on Year Growth
Michael Nealey Jun 11, 2012 12:32 PM (in response to Jonathan Drummey)Hi Jonathon 
I am using your example to ask if this can be used with a continuous date line (I have this problem in a separate post).
I have taken your calculation and tried to show this a line over time...but cannot seem to do it.
Any thoughts?

4. Re: Calculating Year on Year Growth
Jonathan Drummey Jun 13, 2012 2:58 AM (in response to Michael Nealey)Hi Michael,
Having both the discrete (blue) YEAR(Order Date) on the Level of Detail shelf in the view causes Tableau to return a discrete result for each Year(Order Date) and it won't connect the lines unless we tell Tableau how to. Therefore, you have two options:
1) remove the discrete YEAR(Order Date) from the Level of Detail shelf and set your table calcs to compute using Table(Across). That's in the "simplest" worksheet in the attached.
2) Ctrl+drag the blue YEAR(Order Date) from the Level of Detail shelf to the Path shelf. This will tell Tableau how to connect the points and get you a line. Then set the Compute Using for both your table calcs to Order Date. That's in the "more complicated" worksheet in the attached.
Jonathan

5. Re: Calculating Year on Year Growth
Michael Nealey Jun 13, 2012 7:35 AM (in response to Jonathan Drummey)Hi Jonathan, I think you attached the wrong file?
I don't see anything with "more complicated" and "simplest"...
Mike

6. Re: Calculating Year on Year Growth
Jonathan Drummey Jun 13, 2012 7:50 AM (in response to Michael Nealey)Sorry, wrong version, try this one.

7. Re: Calculating Year on Year Growth
Anurag Gulati Jul 4, 2012 6:40 PM (in response to Anurag Gulati)I have tried to work with the example, but still cannot get the correct growth measure. It seems that may be its is to do with data. I have added some sample data to the attached file. My custom calculation is done in "Growth" measure where I am using the formula
(xy)/y
to calculate Growth of x over y but the Growth percentage tableau calculates is really high and incorrect. I also tried to add a Table Calculation where i do not get a Table (Across) option when using Quick Table Calculation and YTD Growth Year on Year Growth are greyed out.
In the attachment
Raw Data file
Test.twbx

Book1.zip 49.0 KB


8. Re: Calculating Year on Year Growth
Vladislav Grigorov Jul 4, 2012 10:57 PM (in response to Anurag Gulati)Hello Anurag,
The problem you experience is due to the way Tableau is calculating your formula. As it is defined as a direct ratio of the fields it is calculated at the level of each individual record. Thus it works fine on the record level, but then when you aggregate many rows into one category, you are getting nonsense  i.e. you are adding percentages, or taking average, etc. In order to make this work you should make it aggregate first all rows and then divide to get the percentage growth. I.e. instead of (xy)/y the correct formula is (sum(x)sum(y))/sum(y). I made exactly that modifying your formula in the attached workbook.
Hope this helps,
Vladi

Test.twbx.zip 28.3 KB


9. Re: Calculating Year on Year Growth
Anurag Gulati Jul 4, 2012 11:43 PM (in response to Vladislav Grigorov)Thanks Vladislav, It Works. Thanks a Million