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

Problem Rank expression

Hi, I have a problem when using this expression for the column Test3  IF (Rank (Total -SUM (tax))<=23, (tax), 0)  with this data source.

The expression does not execute the total when I delete the dimension Code.

Dim1 Dim2 Dim Code taxTest 3
SSite110€ 8,008
20€ 8,008
30€ 8,008
40€ 8,008
120€ 8,008
130€ 8,008
140€ 8,008
170€ 8,008
210€ 8,008
260€ 8,008
50€ 16,0016
60€ 16,0016
80€ 16,0016
150€ 16,0016
160€ 16,0016
180€ 16,0016
200€ 16,0016
220€ 16,0016
230€ 16,0016
240€ 16,0016
70€ 24,0024
250€ 24,0024
270€ 24,0024
100€ 52,000
190€ 65,000
90€ 78,000
110€ 270,000
Tot€ 777,00 0

Exist one solution using the functiion aggr to get the following result?

S1S2Test 3
SSite1€ 312,00
Tot€ 312,00

Thank you

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps: sum(aggr(IF (Rank (Total -SUM (tax))<=23, (tax), 0),Dim1,Dim2,[Dim Code]))


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
sunny_talwar

What is the exact expression you are using? Do you have a sample you can share?

Gysbert_Wassenaar

Perhaps: sum(aggr(IF (Rank (Total -SUM (tax))<=23, (tax), 0),Dim1,Dim2,[Dim Code]))


talk is cheap, supply exceeds demand
swuehl
MVP
MVP

Or maybe (assuming a single Dim1 and Dim2 combination possible (which probably is not like in your real setting)):

Sum({<[Dim Code] = {"=Rank(Sum(tax))<=23"}>} tax)