Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
abbasahmed
New Contributor II

How can I add a percentage of sales growth - Pivot table.

Hi everyone,

I want to add a percentage of sales growth from year 1 to year 2 for each category.

Screen Shot 2017-12-06 at 11.44.33 PM.png

It should be something like this:

Screen Shot 2017-12-07 at 12.50.18 AM.png


The formula

% increase = ((Sales year 2 - Sales year 1) ÷ Sales year 1) X 100

1 Solution

Accepted Solutions
luismadriz
Valued Contributor

Re: How can I add a percentage of sales growth - Pivot table.

Hi Abbas,

Turn On Totals  for Year and change the sales measure to this:

If(Dimensionality()=1,Sum(Sales),Num((Sum({<Year={2}>}Sales)-Sum({<Year={1}>}Sales))/Sum({<Year={1}>}Sales),'0%'))

Untitled.png

I hope this helps,

Cheers,

Luis

6 Replies
luismadriz
Valued Contributor

Re: How can I add a percentage of sales growth - Pivot table.

Hi Abbas,

Turn On Totals  for Year and change the sales measure to this:

If(Dimensionality()=1,Sum(Sales),Num((Sum({<Year={2}>}Sales)-Sum({<Year={1}>}Sales))/Sum({<Year={1}>}Sales),'0%'))

Untitled.png

I hope this helps,

Cheers,

Luis

abbasahmed
New Contributor II

Re: How can I add a percentage of sales growth - Pivot table.

Hi Luis,

Almost there. See what I gotScreen Shot 2017-12-07 at 1.02.01 AM.png

luismadriz
Valued Contributor

Re: How can I add a percentage of sales growth - Pivot table.

Good, you now just need to change Sum(Sales) to Num(Sum(Sales),format)

Check this for formating: http://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/FormattingFunct...

And maybe change the label for Totals to %Growth

Anything else?

abbasahmed
New Contributor II

Re: How can I add a percentage of sales growth - Pivot table.

Thanks a lot

luismadriz
Valued Contributor

Re: How can I add a percentage of sales growth - Pivot table.

You're welcome, you did a good job explaining and documenting the question,

Cheers,

Luis

abbasahmed
New Contributor II

Re: How can I add a percentage of sales growth - Pivot table.

Thanks again

Community Browser