Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Concatenating within a conditional statement

kas
8 - Asteroid

Hello,

 

I'm trying to write a conditional statement, but am receiving a malformed statement error that something at the end is wrong.

 

The logic is; if the field is NOT empty,  then that field should equal a $ plus that field.

It is a string field that I'm working with.

 

as written: IIF(!IsEmpty([Fund_Ending_Value_]) || [Fund_Ending_Value_] = '$' + [Fund_Ending_Value_])

 

current: 28.00

Desired: $28.00   (but only if that field wasn't empty)

 

image attached as well.

 

 

 

4 REPLIES 4
ChrisTX
16 - Nebula
16 - Nebula

IF !IsEmpty([Fund_Ending_Value_]) THEN '$' + [Fund_Ending_Value_]

ELSE [Fund_Ending_Value_]

ENDIF

 

check out examples on the Functions page: https://help.alteryx.com/current/en/designer/functions.html

 

kas
8 - Asteroid

I swear that was the way I tried it first,but was getting a different error!

Obviously I missed a detail then as well.

 

Thank you,

Kim

Deano478
12 - Quasar

@kas I'm a bit late to the party but if you wanna keep the IIF syntax you can do this:

 

IIF(!IsEmpty([Fund_Ending_Value_]), '$' + [Fund_Ending_Value_], NULL())
kas
8 - Asteroid

Thank you! :)

Labels
Top Solution Authors