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: 
Tadyy
Contributor II
Contributor II

SUM of Top 10, ONLY for max date of selection

hello

 

I'm having trouble getting an expression to work correctly. I'm trying to show the top 10 with the sum of only the top 10 aswell,  for the latest date of selection. So if the user selects this whole week, it will show the top 10 data and sum only for today.

I've gotten to the point that I can show the correct data and sum if I only have 1 date selected, but when multiple are selected, it shows the sum of all days (which is not what i want). My current expression:

Sum({<Material={'=Aggr(Rank(Sum([Total Value])), Material)<=10'}>} [Total Value])

Other similar expressions i've done, I use Date={'$(=Max(Date))'}, but it's not showing me the results I want. I assume it SUMs the top 10 over all the selection, because the materials and sum changes when I select/deselect dates even while the latest date stays the same...

Sum({<Date = {'$(=Max(Date))'}, Material={'=Aggr(Rank(Sum([Total Value])), Material)<=10'}>} [Total Value])

Any ideas?

 

Labels (1)
0 Replies