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

Finding Top5 Products in Qliksense

Hello,

Is there any way to show TOP5 products based on sales in QlikSense?

Like we have Dimension Limits in Qlikview, do we have any option in Qliksense?

Thanks,

Nikhil Garg

1 Solution

Accepted Solutions
devarasu07
Master II
Master II

Hi,

try below methods, let's say dimension is Employee and Salary is your fact measure.

Method 1: Using Calculated Dimension

Dimension = Calculated Dimension

=IF(Aggr(Rank(SUM(Salary),4),Employee)<=5,Employee)

Tick Suppress When Value is NULL

Expression = SUM(Salary)

Method 2: Using Set Analysis in Expression

Dimension = Employee

Expression = SUM({<Employee = {"=Rank(SUM(Salary),4)<=5"}>}Salary)

Method 3:  Using Dimension Limit

Dimension = Employee

Expression = SUM(Sales)

Dimension Limits

Select Show only Largest 5 Values

Capture.JPG

Hope this helps to you

Regards,

Deva

View solution in original post

5 Replies
OmarBenSalem

Same thing; just include a limiatation in ur dimension:

Capture.PNG

Anonymous
Not applicable

In Dimension tab->Limitation->Top , You can specify the number or expression

devarasu07
Master II
Master II

Hi,

try below methods, let's say dimension is Employee and Salary is your fact measure.

Method 1: Using Calculated Dimension

Dimension = Calculated Dimension

=IF(Aggr(Rank(SUM(Salary),4),Employee)<=5,Employee)

Tick Suppress When Value is NULL

Expression = SUM(Salary)

Method 2: Using Set Analysis in Expression

Dimension = Employee

Expression = SUM({<Employee = {"=Rank(SUM(Salary),4)<=5"}>}Salary)

Method 3:  Using Dimension Limit

Dimension = Employee

Expression = SUM(Sales)

Dimension Limits

Select Show only Largest 5 Values

Capture.JPG

Hope this helps to you

Regards,

Deva

surendraj
Specialist
Specialist

some add-on to devarasu

--> If you want to show in Text Box

=CONCAT(IF(Aggr(Rank(SUM(Salary),4),Employee)<=5,Aggr(Employee&CHR(9)&MONEY(SUM(Salary),'#,##0'),Employee)),', '&CHR(10),-Aggr(SUM(Salary),Employee))

-->if you want to restrict by Script itself..

Sample script:

Employee:

Load * Inline

[

  Employee, Salary

  A, 10000

  B, 20000

  C, 24000

  D, 40000

  E, 100000

  F, 50000

  G, 125000

  H, 80000

  I, 75000

  J, 40000

  K, 50000

  L, 35000

  M, 25000

  N, 50000

  O, 35000

  P, 20000

];

NoConcatenate

Temp:

Load Employee, SUM(Salary) as Salary Resident Employee Group By Employee;

NoConcatenate

Final:

First 5

Load Employee, Salary Resident Temp Order By Salary Desc;

Drop Tables Employee, Temp;

ranidas
Partner - Contributor III
Partner - Contributor III

Dear Team,
I am new to Qlik sense , just one month experience.
I have a requirement as below .
Need to show Top 2  products based on critical projects count .Structure is exactly similar as attached.

If more than top two products are present , Sum all the remaining critical projects count and show in seperate column name as "Others" and others column should always be positioned last.

In case if, 2 or all products has similar count ,need to pick the top 2 products which comes alphabetically comes first  which is not happening .

Sort by expression, alphebetically,numerically tried , but could not found the desired output.

My Rank expression : 

Rank Exp:Aggr(IF(Num(Rank(sum(Critical Projects),4))<=2,Products,'Others'),Products)

 

Please find the screen shots of dummy data and kindly help!.