Discussion board where members can get started with Qlik Sense.
I'm trying to find a recommended product, based on the following criteria:
1. The product should be the most frequently occurring in the dataset
2. If there is a tie in the product names, then we should display product with highest margin.
For example in this sample dataset:
Load * inline
X and Y are most frequently occurring, but we need to display Y as recommended product as it has highest margin of 80%
I'm able to find the maximum occurrences using this function, but not able to return product with highest margin.
I'm struggling with the Firstsortedvalue function.
It would be great if anyone can provide some help on this.
=FirstSortedValue(Product, -Aggr(Count(Product) + (Max(Margin)/1E10), Product))