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

load and IF Statement

Hi there,

I am having some difficulty with the syntax of the if statement in my load.  I am attempting to say

IF [Field] = Yes OR No, then True, False

the syntax I have is

if (([Field1])='Yes' or ([Field1])='No', 'Reviewed') as REVIEW

im sure this is a simple one but Im stuck, any suggestions?

5 Replies
swuehl
MVP
MVP

What is exactely your issue?

T:

LOAD *,

  if (([Field1])='Yes' or ([Field1])='No', 'Reviewed') as REVIEW

INLINE [

Field1

Yes

No

Maybe

];

seems to work for me.

leocattqv
Creator
Creator
Author

Hi,

Qlik doesnt seem to like the comma between 'No', and 'Reviewed'

I get an error in the script

(([Field1])='Yes' or ([Field1])='No', 'Reviewed') as REVIEW,

swuehl
MVP
MVP

Please post your complete Load statement.

MarcoWedel

Hi,

If(Field1='Yes' or Field1='No', 'Reviewed') as REVIEW

or

If(Match(Field1,'Yes','No'), 'Reviewed') as REVIEW

should also work.

No reason for a comma causing an error.

Maybe it would help if you posted the error message and some sample data?

thanks

regards

Marco

raman_rastogi
Partner - Creator III
Partner - Creator III

try this

if(Field1='yes','true',if(Field1='no','false'))