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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to add within pivot?

Hi everyone,

I´ve created a pivot table in QlikView and would like to calculate the difference between the subtotals (see attached excel).

Any ideas how to define the expression in QlikView?

Thanks,

David

3 Replies
sujeetsingh
Master III
Master III

Use expression Colmn1 - Column2

Not applicable
Author

 

hi,

add  Dimensionality()  as  an extra expression .

if

(Dimensionality() > 0,

 

sum

( total col1) - sum(total col2)) .

Dimensionality() indicates the level of subtotals in pivot tables. For example, if you have a pivot table with dimensions A, B, C  and D,

     the expressions will have a dimensionality of 5

     subtotals for D will have a dimensionality of 4

     subtotals for C will have a dimensionality of 3

     subtotals for B will have a dimensionality of 2

     subtotals for A will have a dimensionality of 1

     the grand total will have a dimensionality of 0

This allows you to tailor the expression to the return the correct value for the totals if you need something other than simple subtotals.

Not applicable
Author

I´ve tried but it doesn´t work 😞