Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

IF AND Statement

grsomer
8 - Asteroid

Hi, 

I am trying to create an if statement that has multiple criteria. My syntax is as follows: if [Is Buy/Sell] = "sell" AND if [TRADE_KEYWORD.BO_ProductType] = "FEES_BBL_ACCR" then "1800" else "1300" endif . I am receiving the error "Malformed If Statement". I am sure this is an easy fix and I am missing something every simple.

1 REPLY 1
Kenda
16 - Nebula
16 - Nebula

Hi @grsomer 

 

The formula you have is close. I would use this expression:

if [Is Buy/Sell]="sell" && [TRADE_KEYWORD.BO_ProductType]="FEES_BBL_ACCR" then 1800 else 1300 endif

 

If the field you're creating is a number, leave it as-is. If you want your new field to be a string, add double quotes around the 1800 and 1300. 

 

Another option, if you want to use the other if statement available in Alteryx would be:

iif([Is Buy/Sell]="sell" && [TRADE_KEYWORD.BO_ProductType]="FEES_BBL_ACCR", 1800, 1300)

 

This does the same thing just in fewer words.

 

Hope this helps!

Labels