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: 
Not applicable

Set Analysis to count when not have a value

I need to count how many Users do not have Category = C.

With the next example, the answer is 1 (User 2)

UserCategoryOption
1A1
1A2
1A3
1A4
1A5
1A6
1B2
1B3
1B4
1B5
1C3
1C4
1C5
1C6
2A1
2A2
2A3
2A4
2A5
2A6
2B2
2B3
2B4
2B5
2B6
2D2
2D3
2D5

I used:

count({<Category -= {'C'}>} distinct User)

but the result is: User 1 = 1 and User 2 = 1

Thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

Hi Deepak, so i get the users that have Category = C (User 1) and need the opposite (User 2)

Addapting your code I did i little change and now it do the correct but maybe there is other better solution.

The syntax i used was:

Count (DISTINCT {<Category-={"C"}>}User)-Count (DISTINCT {<Category={"C"}>}User)

Thanks for your help

View solution in original post

4 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

Try the attach application

Deepak

Not applicable
Author

Hi Deepak, so i get the users that have Category = C (User 1) and need the opposite (User 2)

Addapting your code I did i little change and now it do the correct but maybe there is other better solution.

The syntax i used was:

Count (DISTINCT {<Category-={"C"}>}User)-Count (DISTINCT {<Category={"C"}>}User)

Thanks for your help

deepakk
Partner - Specialist III
Partner - Specialist III

hi,

Yes you can do it in below way.

Count (DISTINCT {<Category =Category-{"C"}>}User)

Deepak

Not applicable
Author

That way it doesn't work.

I attach file