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

Qlik Sense Top 5 Rank based on Drill down Dimension

Hi All,

I have an expression to find ranking based on drilldown dimension below. Its working and I want to show only Top 5 Rank. My drill down dimensions are Country,State and City

if(GetSelectedCount(CalDate)=0,
(rank(aggr(Count({<Entry-={$(vElectronic)},Profileadddate_MonthName={'$(=$(vCurrMnthProfiles))'}>}Entry)
/
Count({<Profileadddate_MonthName={'$(=$(vCurrMnthProfiles))'}>}Entry),$(vRankDrill_Profile)),4,1)),
(rank(aggr(Count({<Entry-={$(vElectronic)},Profileadddate={">=$(=Date(Min(CalDate)))<=$(=Date(max(CalDate)))"}>}Entry)
/
Count({<Profileadddate={">=$(=Date(Min(CalDate)))<=$(=Date(max(CalDate)))"}>}Entry),$(vRankDrill_Profile)),4,1))
)

Can anyone help me to limit my ranking to Top 5

Thanks in Advance

1 Reply
Anil_Babu_Samineni

Try this?

if(GetSelectedCount(CalDate)=0,
(rank(aggr(Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Entry-={$(vElectronic)},Profileadddate_MonthName={'$(=$(vCurrMnthProfiles))'}>}Entry)
/
Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Profileadddate_MonthName={'$(=$(vCurrMnthProfiles))'}>}Entry),$(vRankDrill_Profile)),4,1)),
(rank(aggr(Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Entry-={$(vElectronic)},Profileadddate={">=$(=Date(Min(CalDate)))<=$(=Date(max(CalDate)))"}>}Entry)
/
Count({<CalDate = {"=Rank(Count(Entry),4)<=5"}, Profileadddate={">=$(=Date(Min(CalDate)))<=$(=Date(max(CalDate)))"}>}Entry),$(vRankDrill_Profile)),4,1))
)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful