Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Present limited sales amount

See below straight table. I want to present only the values of customers where the total sales amount is greater or equal than 10.000 and smaller or equal than 20.000. So I only want to see customers X and Z. How do I realise this?

Customer nameMin. priceMax. priceSales amount
Customer S10,0020,00500
Customer X15,0025,0010.000
Customer Y25,0050,0050.000
Customer Z20,0030,0015.000
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Ah, my mistake. Try this:

sum({<[Customer name]={"=sum([Sales amount])>=10000 and sum([Sales amount])<=20000"}>} [Sales amount])

Replace [Customer name ] and [Sales amount] with your exact field names.


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
prasad_dumbre
Partner - Creator
Partner - Creator

sum(if(sum(sales_amt)>=10000 and sum(sales_amt)<=20000,sales_amt))

Gysbert_Wassenaar

You can use this expression: sum({<[Sales amount]={'>=10000<=20000'}>}[Sales amount])

See attached example.


talk is cheap, supply exceeds demand
Not applicable
Author

It is working with below expression, only now you see all instead of only the limited records. 
Do you have also a solution for this?

if (sum(sales_amt)>=10000 and sum(sales_amt)<=20000,sum(sales_amt))

Not applicable
Author

Your example is exactly what I need! Unfortunately the expression is not working in my table. It still shows records under 10.000 and above 20.000.

The sales amount per customer is based on individual sales records per customer.    

Does the first part of your expression ({<[Sales amount]={'>=10000<=20000'}>} needs a sum of sales amount?

If yes, how do I realize this?

Gysbert_Wassenaar

Ah, my mistake. Try this:

sum({<[Customer name]={"=sum([Sales amount])>=10000 and sum([Sales amount])<=20000"}>} [Sales amount])

Replace [Customer name ] and [Sales amount] with your exact field names.


talk is cheap, supply exceeds demand
Not applicable
Author

This is working great, but now I see all instead of only the limited records.

In your example you see only the limited records of the remain customers. I want this too. Do you know a solution for this? 

Not applicable
Author

Are min and max price- expressions in you example? If so, you should add above set analysis:

({<[Customer name]={"=sum([Sales amount])>=10000 and sum([Sales amount])<=20000"}>})

in all of them.