Alteryx Designer Desktop Discussions

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

Create a new FixedDecimal field from an existing FixedDecimal field

vern
8 - Asteroid

I am trying to create a FixedDecimal field from an existing FixedDecimal field if another field equals a certain value

 

vern_0-1634826378677.png

I am fairly new to Alteryx and cannot determine what I am doing wrong.

I just want to create a 2nd field from the original field 'WAGE_AMOUNT'

 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @vern 

 

Change Else "" to Else Null()

 

IF [PAY_SUM_GRP] = "HO1"

THEN [WAGE_AMOUNT]

ELSE Null()

ENDIF

 

"" is a string datatype hence its creating error. Null() is datatype independent which leaves the value blank.

 

Hope this helps : )

annedione
Alteryx
Alteryx

Hi @vern 

 

I think your issue comes from the ELSE statement. you're trying to create a numeric field therefore you want to make sure that the condition you state also match a numerical condition. Assuming [WAGE_AMOUT] is a numeric field, therefore replacing the quotes by a 0 would make more sense.

 

annedione_0-1634827137861.png

 

Thx

 

vern
8 - Asteroid

The only remaining issue is when I use the sum function in Excel to total the original field I get a valid total; however, when I use the sum function to total the new field I get a total of 0?

atcodedog05
22 - Nova
22 - Nova

Hi @vern 

 

You can change it to 0 instead of Null() that way total wont be impacted.

 

IF [PAY_SUM_GRP] = "HO1"

THEN [WAGE_AMOUNT]

ELSE 0

ENDIF

 

If you give us info on the complete usecase we can help you out with the best possible option 🙂

Labels