The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
GELÖST

IF statement inserts 0

marcin2x4
Comet

I wrote a simple if statement:

 

IF [Party Office] = "GULFESTMED"
THEN  [Party Office] = "Gulf East Med"
ELSE [Party Office]
ENDIF

 

Instead of text it inserts value 0 to the attribute. Input format of the field is V_String.

Should I set up a different format ?

8 ANTWORTEN 8
LordNeilLord
Aurora

Hey @marcin2x4,

 

That all looks correct, can you take a screen shot of the workflow and output? Or attach your workflow?

marcin2x4
Comet

image.png

LordNeilLord
Aurora

Can you share the an example of the incorrect output and the formula tool setup as well?

rahul1011
Asteroid

Since you are already selecting the field on which you are using the formula, you don't need to add it in the then section.

 

Try the below:

 

IF [Party Office] = "GULFESTMED"
THEN  "Gulf East Med"
ELSE [Party Office]
ENDIF
LordNeilLord
Aurora

Good spot @rahul1011

marcin2x4
Comet

So funny thing here, after removing the attribute name in THEN part it actually worked.

 

Input:

image.png

 

Output (before formula change):

image.png

 

Output (changed formula):

image.png

 

 

 

rahul1011
Asteroid

Thanks @LordNeilLord

 

@marcin2x4: hope this resolves your issue

marcin2x4
Comet

Yes @rahul1011, great thanks!

@LordNeilLord - thanks as well!

Beschriftungen
Top-Lösungs-Autoren