Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

IF statement inserts 0

mszpot89
コメット

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件の返信8
LordNeilLord
オーロラ

Hey @mszpot89,

 

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

mszpot89
コメット

image.png

LordNeilLord
オーロラ

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

rahul1011
アステロイド

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
オーロラ

Good spot @rahul1011

mszpot89
コメット

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
アステロイド

Thanks @LordNeilLord

 

@mszpot89: hope this resolves your issue

mszpot89
コメット

Yes @rahul1011, great thanks!

@LordNeilLord - thanks as well!

ラベル