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

Grand total in pivot (calculating dependency)

Dear all,

in attached document you'll see a pivot table. Depending on (no) values in column [ds%] the [Kg at 88%] is calculated.The values in that column [Kg at 88%] are correct. Except for the Grand Total which should be 2.115.293, which is the sum of all subtotals, instead of what qlikview calculates. (1.240.284)

Can anybody help me out on this one?

Thx in advance!

Bart

1 Solution

Accepted Solutions
Anonymous
Not applicable

you need add Aggr function to the expression.

=

Sum(

Aggr(

if(sum(r4_ds)=0,

(if(sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)<>0,

sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)

))

,

(if(sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)<>0,

sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)

))

*

(

if(sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)<>0,

if(avg({< Rekening_Groep={'Aankoop voer'}>}if(r4_ds<>0,r4_ds))<>0,

avg({< Rekening_Groep={'Aankoop voer'}>}if(r4_ds<>0,r4_ds)) & '%'

))

)

/.88)

,Grootboek_Grootboekomschrijving, Transactie_Periode))

View solution in original post

2 Replies
Anonymous
Not applicable

you need add Aggr function to the expression.

=

Sum(

Aggr(

if(sum(r4_ds)=0,

(if(sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)<>0,

sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)

))

,

(if(sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)<>0,

sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)

))

*

(

if(sum({< Rekening_Groep={'Aankoop voer'}>} r4_gewicht)<>0,

if(avg({< Rekening_Groep={'Aankoop voer'}>}if(r4_ds<>0,r4_ds))<>0,

avg({< Rekening_Groep={'Aankoop voer'}>}if(r4_ds<>0,r4_ds)) & '%'

))

)

/.88)

,Grootboek_Grootboekomschrijving, Transactie_Periode))

bartvanwetten
Creator
Creator
Author

Hi Konstantins!

Thank you so much for the right answer!

Kind regards,

Bart