Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

IF AND

HM
8 - Asteroid

Hi,

 

I'm trying to insert a formula which can lookup if it is null in 2 fields for the same row/record and if it is then output "No" else output "Yes" --> IIF(IsNull([Field 1]) AND (IsNull([Field 2]),"No","Yes")

 

The error I keep receive is "Malformed If statement".

 

Any help is appreciated - thanks.

14 REPLIES 14
MarqueeCrew
20 - Arcturus
20 - Arcturus
Looks reasonable, but try

IIF(isnull([field1]) && isnull([field 2]),"No","Yes")
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
HM
8 - Asteroid

It worked perfectly! Thank you for that

MarqueeCrew
20 - Arcturus
20 - Arcturus

Great. If you wouldn't mind, could you mark that as solved?

 

thanks,

 

mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
brij
7 - Meteor

HI,

 

I'm getting following error.

IIF(isnull("Part No"),"Include","Exclude")

 

Error: Formula In-DB (32): Error SQLPrepare: [EXASOL][EXASolution driver]function or script IIF not found [line 6, column 20] (Session: 1594182034651602363)

LordNeilLord
15 - Aurora

@brij

 

It doesn't look like Exasol supports IIF.

 

You probably need to use a standard SQL IF

 

IF "Part No" is Null Then 'Include' Else 'Excude' End

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

brij
7 - Meteor

ok thanks so could be Exasol doesnt support but I'm working on Alteryx WF it should have created the column in WF and posted the new column in Exasol.

However here is what I'm trying and still getting the error.

if "Billings$"<"BillingsCost$"
then "Billings$"-"BillingsCost$"
else 0
endif

 

error Im getting-

 

Error: Formula In-DB (32): Error SQLPrepare: [EXASOL][EXASolution driver]syntax error, unexpected IF_ [line 6, column 20] (Session: 1594182456386870715)

LordNeilLord
15 - Aurora

@brij

 

You're using the In-DB tools which need to be coded in the native language of the database, which in this case is Standard SQL

 

More info is here: https://help.alteryx.com/9.5/LockInFormula.htm

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

brij
7 - Meteor

ahh great thanks this makes sense to me now.

ANy thoughts on error message m getting on if formula?

 

BR

Brij

LordNeilLord
15 - Aurora

The error is caused by the format if your IF statement....the way it is written is for Alteryx..which is not the same as SQL.

 

It will need something like:

 

if "Billings$"<"BillingsCost$"
then "Billings$"-"BillingsCost$"
else 0
end

 

I'm not a SQL coder so I'm not 100% sure of the correct syntax

 

@LordNeilLord

Part time Tableau, Part Time Alteryx. Full Time Awesome


Data Lover

Labels
Top Solution Authors