In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

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
19 - Altair
19 - Altair

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
19 - Altair
19 - Altair

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
19 - Altair
19 - Altair

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
19 - Altair
19 - Altair

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

Labels
Top Solution Authors