Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count non selected

My tables consists of:

Customer     Product     Sales £

A                 X               1.00

A                 Y               1.00

A                 Z               1.00

B                 X               1.00

B                 Y               1.00

C                 Y               1.00

I would like to use a list box to select a product and then create a table like below so I can see how many are buying and how many are not:

If product X selected

          Qty customers     Qty customers

          buying                  not buying

X          2                         1

If product Z selected

          Qty customers     Qty customers

          buying                  not buying

Z           1                        2

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You need to clear selections in Product, too:

Count({<Customer =e(), Product=>} TOTAL DISTINCT Customer)

see also attached

View solution in original post

7 Replies
swuehl
MVP
MVP

Create a straight table chart with dimension Product and two expressions:

=Count(DISTINCT Customer)

=Count({<Customer =e()>} TOTAL DISTINCT Customer)

sunny_talwar

Z seems to be bought by 2 customers also. A and C? Isn't it?

Not applicable
Author

Hi swuel

The latter formula is not accepted. Is there a syntax error in it ?

Not applicable
Author

Thanks Sunny T. Now corrected.

swuehl
MVP
MVP

Is it just highlighted by the syntax checker, or is there no result shown in the table?

swuehl
MVP
MVP

You need to clear selections in Product, too:

Count({<Customer =e(), Product=>} TOTAL DISTINCT Customer)

see also attached

sunny_talwar

This should also work for you.

Count({<Product>}TOTAL DISTINCT Customer) - Count(DISTINCT Customer)


Capture.PNG