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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

No Sales customers

 

I need to write query in Qlik Sense to get the count of the customers in Yellow because they are there in table 1 and they are not in table 2

 

 

Table 1

Customer Number

AR Balances

1244

1235

1234

100

1111

1200

2222

4555

Table 2

Customer Number

Sales

1111

2000

2222

1000

3333

400

 

3 Replies
Quy_Nguyen
Specialist
Specialist

Try this:

Count({<[Customer Number] = {"=Sum(Sales)=0"}>}[Customer Number])

Anonymous
Not applicable
Author

Hi Quy Nguyen,

Thanks for the quick response , this helped to some extend , let me put the complete problem, I just want to count if AR Balance is <0 and there is no sales at all in sales tables , hence in the below example

The count should be 2 and the customers are (1244 and 2233) because these two guys either not present in Sales table or there is no entry in the sales table, plus they have negative AR balance.

Note : the customer 1244 having 2 line items with negative value and there is no entry in the sales table that means the count should be only 1 even though there are 2 entries in the customer table. The overall output should be 2.

      

Table 1Sales Table
Doc numberTB 1. Customer NumberAR BalancesST.Customer umberTotal Sales
11244-123522330
21244-1001115000
312441200
412444555
51244400
61244500
71244600
12233-100
22233-300
32233-400
342233100
452233200
1111123
2111234
3111456
4111678
5111890
6111890
Quy_Nguyen
Specialist
Specialist

Try it, i just add Distinct to remove duplicate value

Count({<[Customer Number] = {"=Sum(Sales)=0"}>} Distinct [Customer Number])