Alteryx Designer Desktop Discussions

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

IF statement inserts 0

mszpot89
9 - 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 REPLIES 8
LordNeilLord
15 - Aurora

Hey @mszpot89,

 

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

mszpot89
9 - Comet

image.png

LordNeilLord
15 - Aurora

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

rahul1011
8 - 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
15 - Aurora

Good spot @rahul1011

mszpot89
9 - 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
8 - Asteroid

Thanks @LordNeilLord

 

@mszpot89: hope this resolves your issue

mszpot89
9 - Comet

Yes @rahul1011, great thanks!

@LordNeilLord - thanks as well!

Labels