Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

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