Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

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.

Honored Contributor II

Re: Top 5 relative share in a bar chart

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



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

Learning never stops.