Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

jigonzalez
New Contributor III

Set Analysis, or I think so

Hi. I work with Qlik Sense. I need to get a list of customers who bought an X product.

That X product is the most sold in the current year.

To obtain it, I used the function "firstsortedvalue (ProductName, -Ventas)" that returns the product with the highest sales value.

It shows it in a KPI and it is with respect to the selected year, if a year has not been selected then it obtains by default the one of the most recent year.

I already verified that  and in effect I obtain the product with the most sales (money, not volume by quantity).

But now I have to show a table with exclusively the customers that bought that product and their purchase amount.

I have as Dimension: Clients

I have as Measure: sum (sales)

1 Solution

Accepted Solutions

Re: Set Analysis, or I think so

May be this

Sum({<ProductName = {"$(=FirstSortedValue(ProductName, -Ventas))"}>}sales)

7 Replies

Re: Set Analysis, or I think so

May be this

Sum({<ProductName = {"$(=FirstSortedValue(ProductName, -Ventas))"}>}sales)

jigonzalez
New Contributor III

Re: Set Analysis, or I think so

Excellent, Thanks. Keep in touch

jigonzalez
New Contributor III

Re: Set Analysis, or I think so

I would like them to be seen  from the most recent year. Because, by default it shows all the costumers who have bought during all these years, from 2004 to 2009.

Re: Set Analysis, or I think so

May be this

Sum({<ProductName = {"$(=FirstSortedValue(ProductName, -Ventas))"}, Year = {"$(=Max(Year))"}>}sales)

jigonzalez
New Contributor III

Re: Set Analysis, or I think so

Excellent. Thank you Sunny

jigonzalez
New Contributor III

Re: Set Analysis, or I think so

I will have to do that. I'm trying do a comparison of products, where I need to find my most sold product that wasn't sell the previous year.

Re: Set Analysis, or I think so

May be this

Sum({<ProductName = {"$(=FirstSortedValue({<ProductName = e({<Year = {$(=Max(Year) - 1)}>})>}ProductName, -Ventas))"}, Year = {"$(=Max(Year))"}>}sales)

Community Browser