# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join “Do More With Qlik” with Mike Tarallo to get a first-hand look at the New Authoring Experience, June 29th: REGISTER HERE
cancel
Showing results for
Did you mean:
Contributor II

## Suggestion for more Efficient/Elegant way to use IF(,OR OR OR...)

Hey guys,

I currently have this LOAD statment:

ID,

AGE,

ESP,

...

FROM [] WHERE AGE>0 and AGE<120 and IF(ESP=('1') or ESP=('2') or ESP=('3') or ESP=('4') or ESP=('5') or ESP=('6') or ESP=('7') or ESP=('8') or ESP=('19') or ESP=('20') or ESP=('21') or ESP=('22') or ESP=('23') or ... ,'ok')='ok';

Is there any way to substitute this bunch of OR for something more elegant or less process-consuming?

Labels (1)
• ### IF & OR

2 Solutions

Accepted Solutions

Hi there,

There is a cool material here: If Tips by Rob Wunderlich

Regards

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
MVP

You could replace your IF(ESP=('1').... expression with a Match() statement like this

WHERE AGE>0 and AGE<120 AND Match(ESP,1,2,3,4,5,6,7,8,19,20,21,22,23)

4 Replies

Hi there,

There is a cool material here: If Tips by Rob Wunderlich

Regards

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
MVP

You could replace your IF(ESP=('1').... expression with a Match() statement like this

WHERE AGE>0 and AGE<120 AND Match(ESP,1,2,3,4,5,6,7,8,19,20,21,22,23)

Contributor II
Author

Thanks!

Contributor II
Author

Thanks! I used exactly this