Qlik Community

Ask a Question

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
April 22, 2PM EST: Learn about GeoOperations in Qlik Sense SaaS READ MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
RighettiAndrea
Contributor II
Contributor II

Help with Pivot table values

Hi everyone,

I have a Pivot table with 2 Measures that behave in different way when grouped (I mean the line with the number 3818).

clipboard_image_0.png

As you can see, the left measure (Resa Fonderia) is an Average calculation, while the other one (% Scarto Totale) is a Sum.
I need to have the Sum on both measures.

Below the measure called % Scarto Totale.

clipboard_image_1.png

And here the one called Resa Fonderia.

clipboard_image_2.png

Thanks a lot.

1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum(Aggr(YourExpression, Stampo, CDL, Data))

View solution in original post

6 Replies
sunny_talwar

What exactly do you mean when you say you want sum in both measure? Can you provide the numbers you expect to see? Are we only talking about the totals or the individual rows are incorrect as well?

RighettiAndrea
Contributor II
Contributor II
Author

Hi,
In the column called Resa Fonderia I'd like to see 61,1% (the Sum of the 3 values you see in the picture) and not 28,1% (the Avg of the 3 values).
Thanks a lot!
sunny_talwar

Try this

Sum(Aggr(YourExpression, Stampo, CDL, Data))

View solution in original post

RighettiAndrea
Contributor II
Contributor II
Author

I tried but I get 0 in each field.

clipboard_image_0.png

The formula now is:

Sum(Aggr(Sum([S_ODL.LORDO_FONDERIA])/Sum({<[C_FASI.PRAV]-= {3}, [DT_ARTICOLI.TCICMEDSTD]={">0"}>} [S_ODL.DURATA]/[DT_ARTICOLI.TCICMEDSTD]), Mid([L_ODL.CODPARTE],4,4), [S_ODL.CODCDL], KEY_DATA))
sunny_talwar

You will need to create a new field for this in the script

Mid([L_ODL.CODPARTE],4,4) as ...

Aggr function's dimension cannot be used with calculated dimensions

RighettiAndrea
Contributor II
Contributor II
Author

It works great!

Thank you very much!

(Have you seen the other post I made? Maybe you can help me also there...)