Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Not applicable

How to get top 5 ranking diemensions in string format

ChannelSalesBrandDept
Channel11235SamsungPhone
Channel2354BlackberryPDA
Channel3941OppoPhone
Channel4341NokiaPhone
Channel5924SansuiPhone
Channel61733ToshibaTV
Channel71460ApplePhone
Channel81177MicromaxTV
Channel91719Le10Phone
Channel10917MaximaWatch
Channel31585ApplePhone
Channel41828MicromaxTablet
Channel5689Le10Phone
Channel61364SansuiPhone
Channel71774ToshibaTV
Channel8232ApplePhone
Channel91093MicromaxPhone
Channel101677Le10Phone
Channel1375MaximaPhone
Channel21579Le10Phone

Hi I want to have the saleswise top 5 channels in text or string format not in number format .

I have tried

for first ranked channel - Aggr(if(Rank(Sum(Sales))=1,Channel),Channel)

similarly for second , third , fourth and fifth i have used 2,3,4,5 but this is returning me in number format.


Actually I need to feed this as an input to a set analysis where condition so it is important that this is in text or string format. Please provide any pointers.  


10 Replies
MVP
MVP

Re: How to get top 5 ranking diemensions in string format

If you actually want to use the Channel Top5 in a set expression, I would suggest an advanced search like

=Sum({<Channel = {"=Rank(Sum(Sales),4)<=5"}>} Sales)

Re: How to get top 5 ranking diemensions in string format

May be the OP is looking for the concatenation of all the Channels:

=Concat(DISTINCT {<Channel = {"=Rank(Sum(Sales),4)<=5"}>} Channel, Chr(10))

or

=Concat(DISTINCT {<Channel = {"=Rank(Sum(Sales),4)<=5"}>} Channel, ', ')

MVP
MVP

Re: How to get top 5 ranking diemensions in string format

Maybe, my main point was to use the advanced search in the set expression, the aggregation function is just a sample.

Re: How to get top 5 ranking diemensions in string format

Got it, apologize for not understanding the intent

MVP
MVP

Re: How to get top 5 ranking diemensions in string format

No worries, Sunny

Not applicable

Re: How to get top 5 ranking diemensions in string format

Hi Sunny,

Its giving invalid diemension. Because the sum (sales) inside the " " is taking up as a string . it is not detecting sales as a field. Is the expression fine or do I need to make any changes ?

MVP
MVP

Re: How to get top 5 ranking diemensions in string format

Could you show a screen shot of your current expression or even better, could you upload a small sample QVF?

Not applicable

Re: How to get top 5 ranking diemensions in string format

Capture.PNG

Not applicable

Re: How to get top 5 ranking diemensions in string format

I need permission to share the qvf , its confidential basically. The data I shared was dummy data actually, sales is weeklysales in my db and channel is [DCOE_HIER.LOCATION.CHANNEL_DESC]

Community Browser