Alteryx Designer Desktop Discussions

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

Filter - Multiple criteria

ZahinOsman
8 - Asteroid

Hi guys,

 

I'm trying apply a formula with some data but its giving me the following error;

 

Error: Formula (2): The formula "Fx Trade.Product Type" resulted in a string but the field is numeric. Use ToNumber(...) if this is correct. (Expression #1)

 

I have the following dataset below;

 

Fx Trade.Product TypeFx Trade.Product Sub Type
 FXD
 FXD
 XSW
 DKK
 XSW

 

My formula below is;

 

if IsNull([Fx Trade.Product Type]) and [Fx Trade.Product Sub Type] = "XSW" or "FXD" then "FX"
else [Fx Trade.Product Type]
endif

Masformula.PNG

 

 

 

 

 

 

 

 

 

 

 

The table should ultimately look like this;

Fx Trade.Product TypeFx Trade.Product Sub Type
FXFXD
FXFXD
FXXSW
 DKK
FXXSW

 

4 REPLIES 4
alexnajm
17 - Castor
17 - Castor

Use a Select tool before your Formula tool to change your data type to a Strung data type - currently you are trying to put a string value in a column that’s a Double (or numeric)

binuacs
20 - Arcturus

@ZahinOsman one way of doing this

image.png

nagakavyasri
12 - Quasar
flying008
14 - Magnetar

Hi, @ZahinOsman 

 

Please change output type to [String] and size like 100,

IIF(IsEmpty(Trim([Fx Trade.Product Type])) && [Fx Trade.Product Sub Type] in ('XSW', 'FXD'), 'FX', [Fx Trade.Product Type])

录制_2024_02_26_11_37_13_626.gif

 

Labels