Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculated Dimension in a table

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?

2 Replies
ecolomer
Master II
Master II

Gysbert_Wassenaar

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)


talk is cheap, supply exceeds demand