Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Use subtotal in expression in pivot table

Hi,

I have this pivot table:

pregunta.png

What I want to do in the second column is: value of Jerarquia 2 / Total value of Jerarquia 1

For example:

Jerarquia 1 subtotal = 30 then the second expression should be = 10 / 30 ==> 0,33..

...

Jerarquia 2 subtotal= 20 then the second expression should be = 10 / 20 ==> 0,5

Who can I set the expression to take the subtotal of the first dimension and use it. Can I do that with a qlikview's funtion?

Thanks,

Regards

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Sum(Valor)/Sum(TOTAL <Jerarquia1> Valor)


Capture.PNG

View solution in original post

6 Replies
vishsaggi
Champion III
Champion III

Hello Leandro,

Can you post a sample app to work on?

Thanks,
V.

Anonymous
Not applicable
Author

Here is the app

sunny_talwar

Try this:

Sum(Valor)/Sum(TOTAL <Jerarquia1> Valor)


Capture.PNG

Anonymous
Not applicable
Author

Nice!

It's works!, thaks.

Can you tell me what you do when in the exp you put <Jerarquia1>? I tryed setting in the expression' set analisys {<Jerarquia1=>} but that doesn't work.

sunny_talwar

TOTAL <Jerarquia1> is telling the expression to Total as per Jerarquia1 dimension. To see what it is doing, create a new expression in your table using the expression -> Sum(TOTAL <Jerarquia1> Valor)

Note: TOTAL <FieldName> is different from {<FieldName>}. Second one (set analysis) will ignore selection in FieldName, while the first one will show the total by the listed dimension

Anonymous
Not applicable
Author

Thanks! It's usefull