Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Announcement: Certain actions are currently causing a Page Not Found error. This is a known issue and we are working with the platform vendor to investigate and resolve it.
ilanbaruch
Contributor III

Top 5 relative share in a bar chart

hi all

in my model i have a stacked bar chart with Year-Quarter as first dimension

and customer as second dimension.

i need an expression that will retrieve the top 5  customers for each quarter 

any ideas ?

advanced thanks

 

2 Replies
Highlighted
Partner
Partner

Re: Top 5 relative share in a bar chart

Try this
1. Create this variable:
vRank5 =chr(39)&Concat(aggr(If(Rank(aggr(expresion, customer, quarter)) <=5, customer), customer, quarter),', ')&Chr(39)
2. In your expresion add this in set analysis
customer = {$(vRank5)}

I hope that this will work correctly.

Dan.
pradosh_thakur
Honored Contributor II

Re: Top 5 relative share in a bar chart

SUM({<customer ={"=rank(sum(Sales))<=5"}>}Sales)

 

or

SUM({<customer ={"=rank(sum(Sales),1,4)<=5"}>}Sales)   //depending upon your requirement

Learning never stops.