Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Expression using an OR clause

I am trying to put together a criteria in an expression.

Essentially an OR case

Currently I have :

count({<Stream={'1'}>} CarNP)

I want to add where it is Stream 1 OR Colour like Red. As the cars maybe in Stream 1 or in another stream but have red within the colour field

count({<Stream={'1'}, Colour = {'*Red*'}>} CarNP)

1 Solution

Accepted Solutions

Re: Expression using an OR clause

Try this,

count({<Stream={'1'}> +  <Colour = {'*Red*'}>} CarNP)

8 Replies

Re: Expression using an OR clause

Try this,

count({<Stream={'1'}> +  <Colour = {'*Red*'}>} CarNP)

sureshqv
Esteemed Contributor III

Re: Expression using an OR clause

try

count({<Stream={'1'} and Colour = {'*Red*'}>} CarNP)

Not applicable

Re: Expression using an OR clause

=count(if([Stream] = '1' OR 'Colour = '*Red*' , CarNP)) ;

Re: Expression using an OR clause

=Count(if(Stream='1' or Colour like '*Red*',CarNP))

chetansehgal
New Contributor III

Re: Expression using an OR clause

=count({<Colour={'RED'}>+< Stream={1}>}CarNP)  works fine.

MVP
MVP

Re: Expression using an OR clause

The suggestion by tamilarasu is the correct one. Some of the others will work, but will not be as quick. Others will not work at all.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

Re: Expression using an OR clause

I second that

MVP
MVP

Re: Expression using an OR clause

Maybe it's also possible to use

=Count({<CarNP = p({<Stream={'1'}>}) + p({<Colour = {'*Red*'}>}) >} CarNP)


avoiding the union of two record sets

Community Browser