Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sidhiq91
Specialist II
Specialist II

Top 10 Customers for a particular year

Hi Guys,

I got the below code from Qlik community to find the top 10 customers for a particular year.

=IF(

aggr(

rank(total

aggr( sum( {$<Year={$(=Max(Year)-1)}>} SalValue),itemname)

,0,1)

,itemname)

<=10,

aggr(

rank(total

aggr( sum( {$<Year={$(=Max(Year)-1)}>} SalValue),itemname)

,0,1)

,

itemname))

But, I'm not able to understand anything from this, Could someone please help me step by step on how this code is written?

Regards,

Sidhiq

3 Replies
Anil_Babu_Samineni

Where are you trying this? I meant Dimension or Expression?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sidhiq91
Specialist II
Specialist II
Author

Expression.

Anil_Babu_Samineni

Can you try this as calculated dimension

If(aggr(rank(sum(SalValue)),itemname)<=10,itemname)


and expression is

Sum({<Year = {'$(=AddYears(Max(Year),-1))'}>}SalValue)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful