Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Hariprasad
Contributor II
Contributor II

How to show top 10 sales based on customer in KPi

Hi Team,

I want to show KPI 10 top sales based on customer,  please let me know the calculation for above one.

 

Appreciated for your response in Advance

Labels (1)
1 Reply
WildmoserGeorg
Contributor III
Contributor III

Two options, at least the ones i know of. There`s probably more. Adjust the dimensions and calcultions in the example to match your data model.

 

A) FirstSortedValue:

 =firstsortedvalue([Customer Name], -aggr(sum([Quantity]*[Order Amount]),[Product Name],[Customer Name]),1)&chr(10)&
firstsortedvalue([Customer Name], -aggr(sum([Quantity]*[Order Amount]),[Product Name],[Customer Name]),2)&chr(10)&
firstsortedvalue([Customer Name], -aggr(sum([Quantity]*[Order Amount]),[Product Name],[Customer Name]),3)

 

B) Combi of Concat aggr and if:

=concat(distinct aggr(if(rank(sum([Quantity]*[Order Amount])) <= 3, [Customer Name]),[Customer Name]),chr(10),[Quantity]*[Order Amount])