Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to create a straight table which contains a list of customers. I'd like to have one column showing their top product and the second column showing their second most product. I'm able to get this working for one product only using the formula below:
If(Aggr(Rank(Sum([MONTHLY UNITS])), [CUSTOMER NAME], [PARENT PRODUCT NAME]) = 1, [PARENT PRODUCT NAME])
However, when I try this with a second product it puts it on another line. The desired result is one row per customer with a product name in each column. Any ideas how to do this?
Qlik Sense doesn't have a Straight Table, so I assume you mean the Table object. But this works the same in a Qlikview Straight table and in a Qlik Sense Table. You don't need calculated dimensions. You can use measures/expressions like these:
Top product: FirstSortedValue(Product, -aggr(sum(Units),Product,Customer))
Second best: FirstSortedValue(Product, -aggr(sum(Units),Product,Customer),2)