Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Death4Free
Contributor III
Contributor III

Sum vs Previous Sum By Years, %

Hi! How can I calculate measure in pivot table - Sales Vs Prev. sales, % ( there could be more years, and i have Calendar Master if it helps)?

201620172018
SalesSales Vs Prev. sales, %SalesSales Vs Prev. sales, %SalesSales Vs Prev. sales, %
dec10100%12120%1083%
jan9100%666%8133%
feb15100%16106%18113%
1 Solution

Accepted Solutions
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Aleksandrs,

loading as an example the data you posted, like so:

l

oad * Inline

[

Month,Year,Sales

dec,2016,10

dec,2017,12

dec,2018,10

jan,2016,9

jan,2017,6

jan,2018,8

feb,2016,15

feb,2017,16

feb,2018,18

];

You can get it by using the before statement: before(sum(Sales)).

What it does, on a pivot table, is to get the previous (left) value.

Using the expression, I got:

sample.png

See the attached QVW for example and further expressions that I added.

View solution in original post

2 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Hi Aleksandrs,

loading as an example the data you posted, like so:

l

oad * Inline

[

Month,Year,Sales

dec,2016,10

dec,2017,12

dec,2018,10

jan,2016,9

jan,2017,6

jan,2018,8

feb,2016,15

feb,2017,16

feb,2018,18

];

You can get it by using the before statement: before(sum(Sales)).

What it does, on a pivot table, is to get the previous (left) value.

Using the expression, I got:

sample.png

See the attached QVW for example and further expressions that I added.

Death4Free
Contributor III
Contributor III
Author

Thank you for help