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: 
CasperQlik
Creator
Creator

Getfieldselections 1 or 2 values

Hi Qlik Community

I need help with some logic that I cannot get right.

In my chart I need to only display values if the user selects category c. The field contains values 'cat a', 'cat b', 'cat c'.

My expression looks like this and it works if I select either cat a or b, but if I select them at the same time the chart disaplays. I even tried adding a nested condition where I replaced the "or" with an "and". How do I modify my expression?

if(GetFieldSelections([My Field) = 'cat a' or GetFieldSelections([My Field]) = 'cat b', null(),
Count([values])
)

/Casper

1 Solution

Accepted Solutions
Or
MVP
MVP

Simplified:

If([My Field]='cat c',Count(Values))

 

View solution in original post

2 Replies
FedericoDellAcqua

Hello Casper! 

Are you sure you can't review the logic this way? 

if(GetFieldSelections([My Field]) = 'cat c' ,Count([values]), null())

Please feel free to like the comment if it helps! 😊

Federico

Or
MVP
MVP

Simplified:

If([My Field]='cat c',Count(Values))