Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

If statement with multiple conditions?

I'm trying to develop an If statement that matches several conditions.  The reason I am trying to do this is to remove some data that isn't necessary.

We often have people testing inside our database.  They'll use a User ID like "ed_t" or "D_ET".  So I when I import my data, I don't want to include those in the dataset at all.

My If statement doesn't seem to work, though.  It only matches the first condition.  Any thoughts?

If(left(lower([User ID]), 3) <> 'ed_t' or 'D_ET', 1) as [Exclude User ID]

4 Replies
srinivasa1
Contributor

Re: If statement with multiple conditions?

Write like below

If(left(lower([User ID]), 3) <> 'ed_t'  or  left(lower([User ID]), 3) <> 'D_ET' , 1) as [Exclude User ID]

Not applicable

Re: If statement with multiple conditions?

one comment about lower and 'D_ET': that won't work together:

if lower is necessary, use 'd_et'

Not applicable

Re: If statement with multiple conditions?

If you're comparing the same field in each condition, you can use match, mixmatch, or wildmatch for case sensitive, case insensitive, and wild card matches.

MVP
MVP

Re: If statement with multiple conditions?

Hi,

Try like this

if(mixmatch([User ID], 'ed_t', 'D_ET'), 1 ) AS [Exclude User ID]

Hope this helps you.

Regards,

Jagan.

Community Browser