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
17 - Castor
17 - Castor

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
17 - Castor
17 - Castor

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
17 - Castor
17 - Castor

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
17 - Castor
17 - Castor

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

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels