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. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. 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

SACResearch
6 - Meteoroid

I am trying to do the following formula, but continue to get a malformed if error. Can someone tell me what I'm doing wrong?

 

IF [CUM_HSGPA_Calculated_From_Courses_Unweighted] <="2.00" THEN '0.00 to 2.00' ELSEIF
[CUM_HSGPA_Calculated_From_Courses_Unweighted]>"2.00" AND [CUM_HSGPA_Calculated_From_Courses_Unweighted]<="2.50" THEN '2.01 to 2.50' ELSEIF
[CUM_HSGPA_Calculated_From_Courses_Unweighted]>"2.50" AND [CUM_HSGPA_Calculated_From_Courses_Unweighted]<="3.00" THEN '2.51 to 3.00' ELSEIF
[CUM_HSGPA_Calculated_From_Courses_Unweighted]>"3.00" AND [CUM_HSGPA_Calculated_From_Courses_Unweighted]<="3.50" THEN '3.01 to 3.50' ELSEIF
[CUM_HSGPA_Calculated_From_Courses_Unweighted]>"3.50" AND [CUM_HSGPA_Calculated_From_Courses_Unweighted]<="4.00" THEN '3.51 to 4.00'
ENDIF

12 REPLIES 12
atak1986
6 - Meteoroid

IF [BL]=1 THEN "BL"
ELSEIF
IF [CCG]=1 THEN "Geo"
ELSEIF
IF [DM]=1 THEN "Exclude"
ELSEIF
IF [MG]=1 THEN "G Check"
ELSEIF
IF [MSN]=1 THEN "SN Check"
ELSE
"No Action"

ENDIF

 

 

 

All the field are "Double"

I think everything is in place still it is giving me a "Malformed if Statement" error.

Cassie_Shaw
7 - Meteor

Hi - All help is appreciated. All data types are V_String

Cassie_Shaw_1-1680299038306.png

Cassie_Shaw_2-1680299052590.png

 

 

JohnJPS
15 - Aurora

Hi @Cassie_Shaw - try removing the word "if" word just following the word "and", based on there being one "if" with multiple conditions, as opposed to a nested if.

 

Example of one if with multiple conditions:

if (a = b) and (x = y) then

   ...do stuff...

endif

 

Example of a Nested if:

if (a = b) then

   if (x = y) then

      ...do stuff...

   endif

endif

 

Hope that helps!

Labels
Top Solution Authors