Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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
Highlighted
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.

Highlighted
Specialist III
Specialist III

One solution in frontend.

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

commQV94.PNG