- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Worst Category in dynamic text
Hi can someone please assist me.
I'm trying to find the worst selling category using the Rank function in a text object.
I have already done the best selling category using the following :
='The best selling category is: ' & chr(13) & chr(13) & FirstSortedValue(Category,-aggr(sum(Sales),Category))
The following are the categories ordered according to their sales totals
- Tags:
- new_to_qlikview
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The working formula.
='The worst selling category is: ' & chr(13) & chr(13)
&FirstSortedValue( {<Sales={'>0'}>}Category,aggr(sum(Sales),Category))
It was not working because of a Category(null) with 0 sales. And 0 sales was becoming the worst sales.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just remove the minus before the aggr:
FirstSortedValue(Category,aggr(sum(Sales),Category))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Swuehl. It still doesn't return anything if I do that
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
PFA, it works with Firstsortedvalue,
thought i have tried out with aggr and concat combination. But the First sorted value solution is preferred.
-Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try below for worst
FirstSortedValue(distinct Category,aggr(sum(Sales),Category))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Solution provided by Stefan should usually work. If there are multiple categories with worst sales, you might want to try with Disrtinct like:
FirstSortedValue( Distinct Category,aggr(sum(Sales),Category))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have tried to do what you all have suggested and it still doesn't work.
Please see the attached model. It seems that there is a linking issue because when I drop the DateStoreKey it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aggr and concat works, PFA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you it works perfectly. Could you explain your reasoning to it please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The working formula.
='The worst selling category is: ' & chr(13) & chr(13)
&FirstSortedValue( {<Sales={'>0'}>}Category,aggr(sum(Sales),Category))
It was not working because of a Category(null) with 0 sales. And 0 sales was becoming the worst sales.
- « Previous Replies
-
- 1
- 2
- Next Replies »