Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Subtract upper row in a pivot table

Hi guys!

I'm new in this community and I hope to find a solution to my issue.

I have a pivot table like this

MonthABX
11000
2528
32014

where only Month is a dimension and A and X are expressions.

I want to evaluate X in this mode X(Month) = A(Month - 1) - B(Month).

Can someone explain me how to do that?

10 Replies
Not applicable
Author

Ok,

I made a simple example too. Let me make a rewind and explain the case in more details.

The structure of my table is a little bit more complex as you can see in the attached qvw.

My goal is to evaluate the X column as the sum of A and B of the previous month only if the parameters P1 and P2 are 0.

In the qvw I'm evaluating X using set analysis but it (obviously) works only if a month is selected. I need to evaluate X with the explained rules disregarding selections on month.

In the subsequent table the final result that I must reach

MonthP1P2KeyInOutABX
100A010100-
100B04205-
111A100000
111B40000
200A0205210
200B04301025
201A80000
201B301050
210A100000
211A20000
300B03020140
301B200000
310B100000

Thanks to all and sorry for imprecision.