Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
ShadowsZD
Contributor
Contributor

How to get correct dimension on this

I have my sample data which is this: 

clipboard_image_1.png


What I want to get is the most sold product for each week.

What I did on Qlik was to add week, category and this formula -> 'max(aggr(sum(num_orders), week, category))'

To get the most sold product, but the category dimension makes all the categories appear.

What should I do to filter it and make it so only the most sold category appears, like this:

clipboard_image_0.png




Labels (3)
2 Replies
Victor_Alumanah
Creator
Creator

Try this:

Dimension:

=week

Expression:

Max Orders     =aggr(max(num_orders),week)

 

Max Category   =FirstSortedValue(DISTINCT aggr( category, week, category) , -aggr(Sum(num_orders), week, category) )

While we teach we learn
Brett_Bleess
Former Employee
Former Employee

Luiz, did Victor's post help you get things working as you wanted?  If so, do not forget to return back to use the Accept as Solution button on his post to give him credit and let others know things worked for you.  If you are still trying to get things working, please leave us an update as to where you are with things.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.