Cast your vote for the official 2025 Inspire Pin! Designs were submitted by fellow Community members and reflect the creativity and passion of Alteryx users across the globe. Vote now!
Free Trial

Alteryx Designer Desktop Discussions

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

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

Maheshp
アステロイド

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件の返信4
ShankerV
キャスター

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

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

dwstada
ボリード

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
ラベル
トップのソリューション投稿者