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

total invariant to filters in a pivot table-

hi,

I want to make the total for a pivot table invariant to filters, i tried the overall expression, but i don't know how to di it and where exactly

i have two dimension and one measure:

dimension 1: [Agence] in rows

dimension 2: [Vague] in columns

measure:   sum({<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}([Q206]*Poids))
/sum({<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}Poids)

 

I want the total be invariant to  dimension 1, meaning I want the total of my measure for all " Agence"

 

thank you in advance for your help

 

4 Replies
treysmithdev
Partner Ambassador
Partner Ambassador

You can use the TOTAL keyword to do this.

sum(TOTAL <Vague> {<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}([Q206]*Poids))
/sum(TOTAL <Vague> {<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}Poids)

 

TOTAL will give you the total without being grouped by the dimensions, except those fields listed between < >. So this should give you Sum by Vague for TOTAL Agence.

Blog: WhereClause   Twitter: @treysmithdev
KKahina
Contributor II
Contributor II
Author

Thank you for your response @treysmithdev 

The thing is I don't know where exactly to put that expression, i enabled the totals for the first dimension ( Agence)  that gave the pivot table below, and i don't found a way to edit the expression to make it invariant to filters as explained

clipboard_image_0.png

clipboard_image_1.png

treysmithdev
Partner Ambassador
Partner Ambassador

If you are only wanting this in the total row, you will have to use Pick or If, which will make it slower.

If(RowNo() = 0, sum(TOTAL <Vague> {<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}([Q206]*Poids))
/sum(TOTAL <Vague> {<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}Poids), sum({<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}([Q206]*Poids))
/sum({<[Code du sondage]={'DEFENT'},[Q206]-={'',98,99}>}Poids))
Blog: WhereClause   Twitter: @treysmithdev
KKahina
Contributor II
Contributor II
Author

thank you for quick response @treysmithdev 

it still don't work, i put the expression in the "afficher la colonne si" field in the second  capture i attached in my previous reply.  The total is still variant to filters