Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
jduluc12
Creator
Creator

aggr and max question

Hi,

I have a data set like this.

Customerrankamount
cust1112
cust1214
cust2145
cust2256
cust2345
cust3156

 

I want to make a chart to show

Customeramount of highest rank
cust114
cust245
cust356

 

for the amount column the expression is 

sum({<rank={"$(=only(aggr(max(rank),customer)))"}>}amount)

but it is not working and giving me all zero values.

what am I missing here?

thanks.

Labels (2)
1 Solution

Accepted Solutions
MayilVahanan

HI @jduluc12 

Try like below

Dim: Customer

Exp: Aggr(If(rank=Max(Total<Customer>rank),sum(amount)),Customer,rank)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

3 Replies
richard_chilvers
Specialist
Specialist

Hi

Could you explain the logic behind the chart you want - what do you mean by 'highest rank' - I don't think it is obvious from your example.
jduluc12
Creator
Creator
Author

there is a rank column in the data set.

so whichever amount has the highest rank, we need to show the amount of that

for example, cust2 has 3 rows with ranks 1, 2, and 3. so the chart should show the amount 45 for cust 2, which is the amount for rank 3.

I hope it is clear now.

 

MayilVahanan

HI @jduluc12 

Try like below

Dim: Customer

Exp: Aggr(If(rank=Max(Total<Customer>rank),sum(amount)),Customer,rank)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.