Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
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))
)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)