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

Calculation of the difference of the month with the value of the previous month

Hi everybody,

I am in the process of creating a report in QlikView.

I have the following monthly chart with four columns. 

Month          SUM_QUANTITY                     SUM_VALUE                     +/- PREMONTH
January          31.064.128                                 4.698.123
February        28.421.257                                 4.042.789
March              30.687.398                                 4.374.989
April                 30.189.756                                 4.214.028

I would now like to enter the deviation from the previous month in the column "+/- PREMONTH" for the column VALUE.
So for the month April the deviation to the month March should be entered, for the month March the deviation to the month February should be entered and so on.

For the month of april, the value should be in the field -160.961 (difference to march).

For the month of march, the value should be in the field 332.200 (difference to february). 

What does the solution to my question look like?

 

Thank you.

 Rainer

Labels (1)
4 Replies
Or
MVP
MVP

Probably something similar to Sum(SUM_VALUE) - Above(Sum(SUM_VALUE))

Or_0-1655128317861.png

 

LaettaMan
Contributor
Contributor
Author

Hi Or,

thank you for your quick answer. 

Sorry, but your solution doesn't give me any values back in the column "+/- PREMONTH"

The dimension is VALUE and not SUM_VALUE (sum_value is the column name in the chart). Sorry.

LaettaMan_0-1655130134177.png

 

LaettaMan_1-1655130192116.png

What is here the problem? 

Or
MVP
MVP

Your issue is likely with the added dimension - in your original example there was only one dimension, but here you have two. You may need to add a TOTAL qualifier.

Sum(SUM_VALUE) - Above(total Sum(SUM_VALUE))

LaettaMan
Contributor
Contributor
Author

Hi,

your solution was successful.

Thank you.