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

use subtotal in an expression

hi,

i have a pivot table with 2 dimensions and 3 expressions

error loading image

example :

tt = subtotal of budget marketing for Code_RAy =10 *(CAHT) / subtotal of CAHT for Code_Ray=10

tt=( 54045,1315 * 1604318,866)/1675839,636

what function returns the subtotal field value ???

how to calculate this expression???

thanks,

1 Solution

Accepted Solutions
Not applicable
Author

hi,

i found the answer to my question: the use of the function dimensionality

(if(Dimensionality()=2,sum(total <Code_Ray,Code_Etab> Budget marketing),if(Dimensionality()=1,sum(Total <Code_Ray> Budget marketing),sum(Total Budget marketing)))*sum(CAHT)))

/if(Dimensionality()=2,sum(total <Code_Ray,Code_Etab> CAHT),if(Dimensionality()=1,sum(Total <Code_Ray> CAHT)),sum(Total CAHT)))



View solution in original post

1 Reply
Not applicable
Author

hi,

i found the answer to my question: the use of the function dimensionality

(if(Dimensionality()=2,sum(total <Code_Ray,Code_Etab> Budget marketing),if(Dimensionality()=1,sum(Total <Code_Ray> Budget marketing),sum(Total Budget marketing)))*sum(CAHT)))

/if(Dimensionality()=2,sum(total <Code_Ray,Code_Etab> CAHT),if(Dimensionality()=1,sum(Total <Code_Ray> CAHT)),sum(Total CAHT)))