Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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])