Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pauledrich
Creator
Creator

Exclude records


I have a customer table where I would like to sum sales but only where the transaction has Item A only and not A,B,C or A D & E - every attempt returns where A is included in any transaction.

My expression Sum (<{Product={A}>}TransactionValue)  displays all transactions where A has been purchased - any ideas gratefully appreciated.

5 Replies
Clever_Anjos
Employee
Employee

"Item A" is another field?

swuehl
MVP
MVP

Maybe something like this, assuming you have something like a TransactionID:

=Sum (<{Product={A}, TransactionID = {"=count(distinct Product)=1"}>} TransactionValue) 

Clever_Anjos
Employee
Employee

Sum (<{Product={A}-P({<Product={"B","C","D"}>})>} TransactionValue)

martinpohl
Partner - Master
Partner - Master

As I can see you have a transaction table where there are various line for the product.

So I would concat the products for each order number (left join (transaction) load orderno, concat(Product) as Concatfield resident transactions group by orderno). There are all products concatenated, so you can check only these orders where only product a is in.

Check attachment.

Regards

pauledrich
Creator
Creator
Author

Hi - assume item A is under the heading product and some customers purchase more than one product B,C &D with one transaction number and one Total Amount. I am trying to only show customers that only bought product A and not any other product.