
1. Re: % on YTD calculation
Ashish Chaudhari Jun 10, 2016 2:04 AM (in response to kek soon yong)Hi Kek,
Please find the attached result and confirm the output. I have observed that you are using old version of tableau. I am attaching the workbook which is of tableau 9.3 version.
I have used below calculations.
1. Filter which will restrict the values from 01/01/2016 to selected date in parameter. Place this in filter section and select true.
[Date]<=[Parameters].[Date] and [Date]>=MAKEDATE(YEAR([Parameters].[Date]),01,01)
2. YTD performance
(SUM([CY Sales]))/(SUM([PY Sales]))
3. YTD running performance %
RUNNING_SUM(SUM([CY Sales]))/RUNNING_SUM(SUM([PY Sales]))
4. Running CY sales or PY sales use the table calculations as below.
Thanks and Regards,
Ashish Chaudhari

2. Re: % on YTD calculation
Ashish Chaudhari Jun 10, 2016 2:09 AM (in response to Ashish Chaudhari)Please find the attached workbook below but Im sure this won't open as you are using older version of tableau. Please refer to the calculations that I have pasted in previous post.
Thanks
Ashish Chaudhari

Book2.twbx 24.6 KB


3. Re: % on YTD calculation
kek soon yong Jun 10, 2016 6:04 AM (in response to Ashish Chaudhari)Hi Ashish,
Thanks for the quick reponse!
however this is not the solution i need.
I can't seem to attach files now, so let me try to explain using excel.
Cell H2 is the parameter, so in this case if i select date 5/1/2016, my current YTD PY Sales (C8) will be the sum of C2 to C6
and current YTD CY sales (D8) will be sum of D2 to D6.
Tableau is doing it fine, see 2nd screenshot as the numbers tally.
However the problem appears when i want to calculate YTD performance.
Tableau seems to be summing up column E2 to E6, thus getting 31.7%.
What i need is 6.6% instead (sum of D2:D6)/sum of (C2:C6). Thanks


5. Re: % on YTD calculation
Ashish Chaudhari Jun 10, 2016 6:38 PM (in response to kek soon yong)1 of 1 people found this helpfulHi Kek,
The calculations that I have shown above in the first post is doing same thing. Refer to the screenshot below. (Red coloured box) Its giving you the same out put. How ever you can go ahead and subtract 1 from it to get the desired result you want.
Check the below screenshot for the same.
I have changed YTD performance Running as below
(RUNNING_SUM(SUM([CY Sales]))/RUNNING_SUM(SUM([PY Sales])))1
You can go ahead and remove the months if you want. You will get the desired result.
Ashish

6. Re: % on YTD calculation
kek soon yong Jun 12, 2016 11:58 AM (in response to Ashish Chaudhari)Hi Ashish,
Yes that's what i needed. Thanks so much!

7. Re: % on YTD calculation
Ashish Chaudhari Jun 12, 2016 10:38 PM (in response to kek soon yong)Hi Kek,
If your queries are resolved then can you please mark the appropriate response as correct and close the thread. This will help many who are looking for this solution.
Thanks and Regards,
Ashish Chaudhari