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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
tursic
Contributor II
Contributor II

comparing total data with data in actual selection

Hello.

I have customers (with customer_id) and orders (with order_id).
Every customer belongs to a salesman.

Now I want to show all customers of the selected salesman, which have no orders in the selected period.

Is that possible?

I thought, it may work by comparing a list of all customers of the salesman with a list of customers in the actual selection.

But how can I get a list of all data regardless the selection, and how can I compare it with the actual data?
As far as I know, keywords like 'total' only work with calculations like 'sum'.

Can anybody help?

2 Replies
GaryGiles
Specialist
Specialist

For your Customer dimension, try this:

Aggr(Only({$<customer_id={"=count(order_id)=0"}>} customer_id), customer_id)

This will give you customers with no orders.  If a selection is made in the salesman and/or period field, the criteria of {"=count(order_id)=0"} will filter according to those selections and render the appropriate customers.  Note: it will also filter on any other fields that you filter on.  

tursic
Contributor II
Contributor II
Author

Thanks for the answer.

This works, when selecting a salesman, but when I select a period, there is no data at all.