Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with simple if statement containing "and"

Hi,

This statement is not working for me.

Anyone got a clue of what is wrong?

If("t_invc"=1 and "t_rtrn"=0,1,0) as Flag_InternalSales, // 1=Yes,0=No

Freddy

1 Solution

Accepted Solutions
Not applicable
Author

Hi. Sorry guys. "t_rtrn" do not have 0 as a value. Only 1 and 2. That explains it. Thanks again.

View solution in original post

7 Replies
nilo_pontes
Partner - Creator
Partner - Creator

Remove the quotes Freddy

Regards,

Nilo

alexandros17
Partner - Champion III
Partner - Champion III

If(t_invc=1 and t_rtrn=0,1,0) as Flag_InternalSales



Not applicable
Author

Hi, thanks for the input. Do not work to remove quotes as the data model has these quotes from the database.

jer_2011
Creator II
Creator II

hello try so If(t_invc=1 or t_rtrn=0,1,0) as Flag_InternalSales

Not applicable
Author

Hi. Sorry guys. "t_rtrn" do not have 0 as a value. Only 1 and 2. That explains it. Thanks again.

stigchel
Partner - Master
Partner - Master

I'm not sure about the quotes, I would remove them in load script.

If not possible you can try if this helps (not sure):

If(["t_invc"]=1 and ["t_rtrn"]=0,1,0) as Flag_InternalSales

Not applicable
Author

Try with this:

If("t_invc"=1, if("t_rtrn"=0,1,0)) as Flag_InternalSales, // 1=Yes,0=No