community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More
SOLVED

IF AND

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.

Alteryx Certified Partner
Alteryx Certified Partner
Looks reasonable, but try

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

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Asteroid

It worked perfectly! Thank you for that

Alteryx Certified Partner
Alteryx Certified Partner

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 reboot. Order shall return.
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)

Alteryx Certified Partner

@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

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)

Alteryx Certified Partner

@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

Meteor

ahh great thanks this makes sense to me now.

ANy thoughts on error message m getting on if formula?

 

BR

Brij

Alteryx Certified Partner

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