Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
vinod2086
Creator II
Creator II

Top 10 % in qlik sense

Hi All,

i have a requirement to display top 10 % and Bottom 10% based on KM/lit.

i have a fields ID and KM/Lit.

KM/Lit=(sum(Diff_distance_drive)/sum(Diff_total_fuel_consumption)


i have used below expression to display top 10 ID's,


=Aggr(if(rank(sum(Diff_distance_drive)/sum(Diff_total_fuel_consumption))<=,ID,NULL()),ID)

here i want to display top 10 % which means

i have total 60 ids out of 60 i want to display 6.

eg: 60*(10/100)=6

6 is top 10% values.

Please help me.

if you need more information please let me know.i need to resolve ASAP.

Thanks, In Advance

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

Hi Kumar,

Create a variable:

vTop10 = Count(total distinct ID)*(10/100)

Then in exp:

=Aggr(if(rank(sum(Diff_distance_drive)/sum(Diff_total_fuel_consumption))<= $(vTop10),ID,NULL()),ID)


Br,

KC

Best Regards,
KC

View solution in original post

3 Replies
jyothish8807
Master II
Master II

Hi Kumar,

Create a variable:

vTop10 = Count(total distinct ID)*(10/100)

Then in exp:

=Aggr(if(rank(sum(Diff_distance_drive)/sum(Diff_total_fuel_consumption))<= $(vTop10),ID,NULL()),ID)


Br,

KC

Best Regards,
KC
vinod2086
Creator II
Creator II
Author

Hi Jyothis,

Thanks for your reply.

yes same way i did now i can able to see top 10 %.based on id

jyothish8807
Master II
Master II

You are welcome

Best Regards,
KC