Question:
I need to sort a query in ascending order based upon the net value of orders for a material group.
As far as I know there are two ways of doing this.
1. Top n. I know that we only have a certain number of material groups so I could use a Top 100 list. I am worried that further material groups may be added in the future though.
I prefer this to the second option, as I don't need to display the ranking, it is implied in the query.
2. Ranked list. However, I also need to display the net value as well as the ranking.
Is that clear? What I want to see is:
MG Value Rank
0002 10,000 1
0001 9,000 2
0003 7,000 3
Are there any other ways of achiving this?
Answer:
For option 2 : use the same KF again in you query > right-click > properties > play with the options "calculate result as" and "calculate singel value as" ... there is an option like ranked list but i don't know eexaclty which setting it is...
Should be easy to find out by testing
tom
Answer:
BWBlagger,
I do not see any conflict in using both the 'Top N' condition and the 'Ranked List' in the KF you want to use.
Just drag twice in the query the KF you want to perform the calculation on. Leave the first one you drag in like it is. The second time you drag in the same KF, change its 'Calculate single line as...' property to 'Ranked List'.
It should work.
Cheers,
michelino
Answer:
Thanks, adding the key figure in again and changing the property to ranked list works great.
Any thoughts on my Top n problem?
I have about 60 material groups and I want them listed in descending order, so I am using a Top 100 list. However, what if more material groups are added in the future? Is there a way of sorting the output without using a Top n?
Answer:
if you use Rank List, aren't they sorted automatically then?
You can always do a manual sort of the result once the query has run (right-click on the KF on which you want to sort and choose "Sort"), but i don't know a way of doing this in the query definition...
For you Top N : instead of specifying a fixed value, you could make a variable of type "customer exit" so that you do a count of the nr. of material groups and then dynamically take that number for your Top N, but this is mayba a little far-fetched..
(on the other hand : why not make it a Top 1000, you never gonna reach that with material groups i think)