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

Formula, replacing null with statement

CherylH
8 - Asteroid

Hi,

 

Have a list and adding comments when a line is remove from final output with an error.  Where have I gone wrong in 2nd statement.  Guess I have issue with writing correct statements. 

 

1st statement works:  Adding column if [LOB]="Facility Services" then "Remove LOB Facility" else Null() endif

 

2nd statement is malformed statement error even though statement is highlighted correctly:

 

iF(IsNull([Remove from list] and if [LOB]="International Non-Operating" then "Remove LOB Intl" else [Remove from list] endif

 

Expected result

WORKSDoes not Work   
Statement #1 Adds column and logic or nullStatement #2LOBADDR_LINE_1CITY_LOCALITY
Remove LOB FacilityRemove LOB FacilityFacility Services123Downers Grove
(null)Remove LOB IntlInternational Non-Operating456HOUSTON

Thanks in Advance for helping.

Cheryl

3 REPLIES 3
Luke_C
17 - Castor

Hi @CherylH 

 

Try this, removed the IF after the 'and' and added a parenthesis to the isnull formula

 

IF  IsNull([Remove from list]) AND [LOB]="International Non-Operating"

then "Remove LOB Intl"

else [Remove from list]

endif

CherylH
8 - Asteroid

Luke,

 

Now formula goes black after the Then.  Data type is V-String.

 

IF  IsNull([Remove from list]) AND [LOB]="International Non-Operating"

then "Remove LOB Intl"

 

Any other idea?

CherylH
8 - Asteroid

Luke,

Never mind, I retyped it instead of copying your response and it works.

 

I was really overthinking the formula.

 

Thanks for helping

Labels