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: 
gopal5879
Creator
Creator

Ranking on multiple measures Top 3 Customers With Sales amout or Top 3 customers by Product Count

Hello Folks, 
Looking for help. Can you give some insight to provide Top 3 customers by sales plus top 3 customers by product count.

Appreciate your time and help.

ScreenShotExample.jpg

3 Replies
vamsee
Specialist
Specialist

On the script side you can try

Step1:
Load
	Cust,
	Sum(Sales) as Sales_Cust
Resident Sales
Group By 
	Cust
;

Left Join(Sales)
First 3 Load
	Cust,
	RowNo() as Cust_Rank
Resident Step1
Order by 
	Sales_Cust Desc
;
Drop Table Step1;

Step1:
Load
	Cust,
	Sum(Prod_Count) as Cust_Prod_Count
Resident Sales
Group By 
	Cust
;

Left Join(Sales)
First 3 Load
	Cust,
	RowNo() as Cust_ProdCount_Rank
Resident Step1
Order by 
	Cust_Prod_Count Desc
;
Drop Table Step1;

If you want this on the front end use

Rank()

 

Note: If two customers have same sales or same product count then they would be ranked based on load order.

Saravanan_Desingh

One solution in frontend.

=Concat({<Customer={"=Rank(Sum(Sum_SalesAmount))<=3"}>}Customer,', ')
=Concat({<Customer={"=Rank(Sum(Sum_Product_Count))<=3"}>}Customer,', ')
Saravanan_Desingh

commQV94.PNG