Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yink-hpv
Contributor III
Contributor III

Top 80 bottom 20

Hi All: I'm fairly new to Qlik Sense, i have a question of calculate top 80 bottom 20 sales for each of ID.


ID Vendor Sales is raw data, i have manually calculated the result on column top80/bottom20


any one can help me set up set analysis in Qlik Sense or loading script to achieve this?

although i have sorted data by ID and Sales amount, the original isn't in a sorted order.

@Sunny Talwar i have read your post before, and use you QVF file for reference.

   

IDVendorSales% of sum by IDTop80 /Bottom 20
CH6004%Bottom 20%
CC9006%Bottom 20%
CG12008%Bottom 20%
CA13009%Top 80%
CD150010%Top 80%
CE150010%Top 80%
CB200013%Top 80%
CC250017%Top 80%
CF350023%Top 80%
NA3002%Bottom 20%
NH9007%Bottom 20%
NE11009%Bottom 20%
NA140011%Top 80%
NG140011%Top 80%
NB210017%Top 80%
NB220017%Top 80%
ND320025%Top 80%
5 Replies
OmarBenSalem

is this correct?

Capture.PNG

the measure used :

if(subfield(rank(sum({1}Sales),Type),'-')<(max(total <Type> aggr(rank({1}sum(Sales),Type),Type,Vendor)) * 0.8) ,'Top 80%','Bottom 20%')


see the attached app

yink-hpv
Contributor III
Contributor III
Author

thanks for sharing Omar, it looks result incorrectly, they all bottom 20% after apply set analysis

OmarBenSalem

Can you share your expression?

If it works once; we should be able to make it work with a different set expression

yink-hpv
Contributor III
Contributor III
Author

i haven't work it out yet, it looks like a difficult for me