Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
swuehl
MVP
MVP

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)

sunny_talwar

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, ', ')

swuehl
MVP
MVP

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

sunny_talwar

Got it, apologize for not understanding the intent

swuehl
MVP
MVP

No worries, Sunny

Not applicable
Author

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 ?

swuehl
MVP
MVP

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

Not applicable
Author

Capture.PNG

Not applicable
Author

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]