Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Facundo
Contributor II
Contributor II

Sum TOTAL with TOP N

Hi!, sorry for my bad english, I have a chart to display the top 5 VALOR_FIJO per FILIAL, but i need an expression to display the sum(total <FILIAL> NUM_CANTIDAD), but is always filtered for the top 5 of VALOR_FIJO, i've tried sum({<VALOR_FIJO=>} total <FILIAL> NUM_CANTIDAD) without success.

Pivot Table :

Dimension 1 : Filial

Dimension 2 : =aggr(if(rank(sum(NUM_IMPORTE_TOTAL_MAPA_CONTRATO))<=5,VALOR_FIJO),VALOR_FIJO)

Expression : SUM({<VALOR_FIJO=>} TOTAL <FILIAL> NUM_CANTIDAD)

1.png

The chart is displaying 24807, but the real number is 61196.

24807 is the total of the VALOR_FIJO displaying.

VALOR_FIJOSUM(NUM_CANTIDAD)
0.008907
287.007708
71.504336
120.002363
196.001493

TOTAL : 24807

I can get the real value if i remove the <FILIAL> from the expression : sum({<VALOR_FIJO=>} total NUM_CANTIDAD)

But if I filter more than 1 FILIAL, I get the full total, and not the total of each FILIAL.

Any ideas of how can i achieve this?

Thanks!

1 Solution

Accepted Solutions
6 Replies
sunny_talwar

Would you be able to share your app to try out few things?

Facundo
Contributor II
Contributor II
Author

App shared

sunny_talwar

Does this look right?

Capture.PNG

Facundo
Contributor II
Contributor II
Author

Thanks, that fixed the problem, but now i figured out that if you have selected just one FILIAL, you can see 5 values for that FILIAL, but if you have selected many FILIAL, you can't see 5 values per FILIAL!

sunny_talwar

Check now

Capture.PNG

Facundo
Contributor II
Contributor II
Author

PERFECT!, thanks you very much!, it was driving me crazy.