Alteryx Designer Desktop Discussions

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

Malformed IF Statement - Help Please

Cassie_Shaw
7 - Meteor

Morning community - Any help is appreciated. Data type is V-string for all.

Cassie_Shaw_0-1680524049022.png

Cassie_Shaw_1-1680524056935.png

 

6 REPLIES 6
alexnajm
16 - Nebula
16 - Nebula

Remove the second "if" on the second line!

ShankerV
17 - Castor

Hi @Cassie_Shaw 

 

Please break the 3 = check into two like below.

 

IF [# OF ONE TIME PAYMENTS] * [POSSIBLE FDB MULTI BENEFICIARY]  = [EE CONTRACT FLAT DEATH_BENEFIT] AND

[EE Death Benefit Owed?] = "0.00"

THEN "Yes Multi"

ELSE "No"

ENDIF

 

Note: When you use the values inside "", then the incoming datatype should be string.

If its numeric datatype use without "" i.e 0.00 like that.

 

Many thanks

Shanker V

alexnajm
16 - Nebula
16 - Nebula

IF ([# OF ONE TIME PAYMENTS] * [POSSIBLE FDB MULTI BENEFICIARY]) = [EE_CONTRACT_FLAT_DEATH_BENEFIT] AND [EE Death Benefit Owed?] = "0.00" THEN "Yes Multi" ELSE "No" ENDIF

 

It might be good to change your [EE Death Benefit Owed?] to numeric as a heads up! In which case you would remove the quotes [EE Death Benefit Owed?] = 0

alexnajm
16 - Nebula
16 - Nebula

If any of the  columns remain strings as you indicated, you can either change them beforehand with a Select tool to numeric or use the ToNumber function around each of the columns.

 

IF (ToNumber([# OF ONE TIME PAYMENTS]) * ToNumber([POSSIBLE FDB MULTI BENEFICIARY])) = ToNumber([EE_CONTRACT_FLAT_DEATH_BENEFIT]) AND ToNumber([EE Death Benefit Owed?]) = 0 THEN "Yes Multi" ELSE "No" ENDIF

Cassie_Shaw
7 - Meteor

@alexnajm - aha! Thank you - the "to number" worked perfectly! Appreciate the quick assistance!

alexnajm
16 - Nebula
16 - Nebula

No problem @Cassie_Shaw! Please accept the solution(s) when you can to complete this thread :)

Labels