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

How to use an OR clause in a CountIf statement?

Hi, I have the following data table sample:

SystemABC
1YNN
2NYY
3NNY
4NNN

 

In one of my dashboards, I want a view to show Systems that are equal to A = Y or  B = Y or C = Y. So in this example only System 1, 2 and 3 are should show.

Currently I have tried 

=Count({< A = {'Y'} or B = {'Y'} or C = {'Y'}>} System)

But i just get an error in expression. 

Thanks

Labels (5)
1 Solution

Accepted Solutions
rubenmarin

Hi, the syntax can be: =Count({<A={'Y'}>+<B={'Y'}>+<C={'Y'}>} System)

So, differnet sets identified between <>, with + to make an OR between this sets

View solution in original post

2 Replies
rubenmarin

Hi, the syntax can be: =Count({<A={'Y'}>+<B={'Y'}>+<C={'Y'}>} System)

So, differnet sets identified between <>, with + to make an OR between this sets

Brett_Bleess
Former Employee
Former Employee

Just posting Help link on things as there is further documentation there on what Ruben mentioned:

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

The following Design Blog may be helpful too:

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

I am going to mark Ruben's post as the solution given you have not replied back, so I am assuming that worked.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.