Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
deepak_km9886
Creator
Creator

Most occuring product

Screenshot (43) - Copy.png

I have given most occuring product for reference.

I need to return the product that is most frequently occuring product based on Measure .

Here E should return, since it has highest occurrences even though its margin is great.

My question is

Screenshot (43).png

when i have two or more most occuring product for eg D and E, then it should compare with the Margin % and should return D, since D has more margin %.

The expression should work if there are same number of products or not.

If there is no same number of occurrences, then directly it should print out highest margin % of highest occurences.

if there is a tie between count of products then, highest one with margin % should be returned.


How to achieve in qlik sense?

1 Solution

Accepted Solutions
sunny_talwar

Just like the other one...

FirstSortedValue(Product, -([Most Occuring Product] + Margin%/1E10))

View solution in original post

7 Replies
sunny_talwar

Just like the other one...

FirstSortedValue(Product, -([Most Occuring Product] + Margin%/1E10))

YoussefBelloum
Champion
Champion

another alternative would be something like this:

=if(rank(TOTAL sum([most occuring product])&sum(margin))=1,  only(product))

deepak_km9886
Creator
Creator
Author

deepak_km9886
Creator
Creator
Author

I'm not getting the output. Just seeing a hyphen. Can  you share the screen shot

sunny_talwar

You marked the correct response... is this resolved now? If not, can you share the app where this isn't working for you?

deepak_km9886
Creator
Creator
Author

For the dummy inline data it is working, for the actual data it isnt working. Getting hyphen

sunny_talwar

Would you be able to provide a sample or sample image to show the issue? The more info you can provide, the easier it will be to help you out...