Alteryx Designer Desktop Discussions

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

Required "H" & "S" on less or greater value

Maheshp
8 - Asteroid

Hi Team,

 

As per the below data we do have the amounts in positive and negative value, with the help of this we required "H" & "S", if amount is in negative then value it will come as "H", in positive value it would be "S".

 

AmountRequired Detail
-54H
-43.1H
56.92S

 

Regards,

Mahesh

 

 

4 REPLIES 4
ShankerV
17 - Castor

Hi @Maheshp 

 

Please use Formula tool.

 

Formula tool settings:

Output column: Output

IF Contains(ToString([Amount]), '-')
THEN "H"
ELSE "S"
ENDIF

Data type: V_String

 

Many thanks

Shanker V

Maheshp
8 - Asteroid

Can you please provide the complete formula, along with <> zero as this is creating the confusion.

dwstada
11 - Bolide

that is the complete formula

 

it turns the number into a string, then looks if there is a "-" in it (so for all negative numbers) and asigns "H" to those records, all the others get an "S"

Qiu
21 - Polaris
21 - Polaris

@Maheshp 
Can we simply use below?

IF [Amount]<0 THEN "H"
ELSEif [Amount]<0 then "S" else "Check"
ENDIF
Labels