Announcements
cancel
Showing results for
Did you mean:
Creator

## Calculating Percentage change in a pivot table as a field

Hi Guys, I want to be able to show % change in sales from 2017 to 2018 in a pivot table that looks like this-

So there will be a new column " growth from '17 to '18 " that will reflect the percentage change from 2017 to 2018 for australia, austria , belgium and so on. The first entry will thus be -84% for change in sales in Australia -->  (2018-2017)/2017

Can anyone tell me how the code for this should be?

1 Solution

Accepted Solutions
MVP

May be this

Sum(Sales)/Before(Sum({<[Fiscal Year]>}Sales)) - 1

5 Replies
MVP

May be this

Sum(Sales)/Before(Sum({<[Fiscal Year]>}Sales)) - 1

Creator
Author

This worked instantly! Thanks a ton!

MVP

Best,

Sunny

MVP

Please look here to see how you should be closing a thread

Qlik Community Tip: Marking Replies as Correct or Helpful

Contributor

I am using flags and other dimensions. how do i write it.

sum({\$<%df_IsThisDate={1}, %Process={"Sales"},[SKU Group] = {'Blocks'}>} [# Net Amount])/Before (sum({\$<%df_IsThisDate={1},FiscalYear, %Process={"Sales"},[SKU Group] = {'Blocks'}>} [# Net Amount])) - 1

Thanks