Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to subtract lines in pivot table

hello,

is it possible to subtract lines in a pivot table?

example :

Table :

C or P
DateAmount
C01/01/2012500
C01/02/2012600
P01/03/20126000
P01/01/201250
P01/01/201250
C01/01/2012200

Pivot table :

C or PDate
P6100
C1300
Difference4800

Pivot table 2

C or PJan 2012Fev 2012Mar. 2012Total
P100060006100
C70060001300
Difference-600-60060004800

How to calculate the line "Difference" please ?

Thanks for your help


1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Would this help?

Regards,

Kiran Rokkam.

View solution in original post

3 Replies
Not applicable
Author

Hi,

Would this help?

Regards,

Kiran Rokkam.

Not applicable
Author

thanks you for your help

is it possible to put the negative amount when P is less than C ?

Not applicable
Author

I found the solution just replace 'fabs' by 'num' and replace the formula like this :

NUM(Sum({<[C/P]={'P'}>} Amount)-Sum({<[C/P]={'C'}>} Amount))