Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set analysis

Hi Experts,

I am using

=count({<Resource={'A','B' }>}ID)   to get the count of ID which are having Resource A and B.

I have a list box Resource

If I make any selection on Resource filter my count is not changing .

Why ??

PS : dont use 'not equal ' count({<Resource -={'A','B' }>}ID)

Thanks

BKC

1 Solution

Accepted Solutions
PrashantSangle

Hi,

In your set analysis you are hard coded for count of ID where Resource is A or B

There fore after making any selection Count is not changing.

IF want to change your count on the basis of Selection just use

count(ID)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

9 Replies
Anonymous
Not applicable
Author

hic‌ Please comment

Thank you in advance

PrashantSangle

Hi,

In your set analysis you are hard coded for count of ID where Resource is A or B

There fore after making any selection Count is not changing.

IF want to change your count on the basis of Selection just use

count(ID)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

Hi

you are using Set analysis to fix your scope to A and B values.

So of course Resource selection won't change the result WHICH IS SET

If you want to make a count of ID just (count(ID))  then select resources, it will change

best regards

Chris

ashwanin
Specialist
Specialist

Hi

In expression =count({<Resource= {'A','B' }>}ID)

You have added the count of Resource A and B, which is equal to 8. therefore it is counting it as 8.

awhitfield
Partner - Champion
Partner - Champion

The expression is doing exactly what you told it  too!

What did you actually want it to do?

Andy

Anonymous
Not applicable
Author

If you want to count only Resources A and B and take selections into account, this expression is probably what you need:


=count(if(Resource='A' or Resource='B',ID))

mikecrengland
Creator III
Creator III

I think you want the intersection. Try

=count({<Resource *= {'A','B' }>}ID)


Using the * let's you select among the items in your set, but not outside those items.


mike


EDIT PS The editor will show a red underline indicating bad syntax. It's a bug in the editor that Qlik hasn't fixed for years.

Anonymous
Not applicable
Author

I am just comparing when I use count({<Resource -={'A','B' }>}ID)  then my selection is reflecting but in = its not.

So wanted to why its happening .

Thanks All.

awhitfield
Partner - Champion
Partner - Champion

- Exclusion Returns records that belong to the first but not the other of the two set identifiers.