Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

How to show all customers

My Customer table is like:

111.PNG

Sales Category table is like:

222.PNG

I'm trying to create a pivot table and a Category filter. I want to implement:

1. By default, it's showing YES if a customer sales either apple or banana, NO if a customer sales neither.

333.PNG

2. If select APPLE, show YES for customers who sales apple, NO for customers don't.

444.PNG

I'm creating the model by Sales Category left join Customer. My function is:

IF(COUNT(Category)>0,'YES','NO')


It works well without filters. But if I selected only Apple, it would only show C2 &C3 with 'YES'.

How should I modify my model or function?

Thanks in advance!!!

1 Solution

Accepted Solutions
sunny_talwar

Or this

If(Len(Trim(If(Count(Category) > 0,'YES','NO'))) = 0, Only({1} 'NO'), If(Count(Category) > 0,'YES','NO'))


Capture.PNG

View solution in original post

2 Replies
petter
Partner - Champion III
Partner - Champion III

You can try

IF(COUNT( {1} Category)>0,'YES','NO')

sunny_talwar

Or this

If(Len(Trim(If(Count(Category) > 0,'YES','NO'))) = 0, Only({1} 'NO'), If(Count(Category) > 0,'YES','NO'))


Capture.PNG