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
Solved! Go to Solution.
Couple of things here
First, you don't have a final ELSE statement which is causing an issue.
Also, you can't use < and > with "strings"
Remove the quotes around your values when using < or >. Those values must be numeric.
I have changed it to the following:
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 ELSEIF Null()
ENDIF
Still shows as an error.
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' ELSE 'ERROR' ENDIF
This is the interpretation that will work. I didn't test for NULL, it will catch null in the ELSE.
Note: This results in a STRING. Make sure that your field is defined as a vstring.
Thanks,
Mark
IF ELSEIF ELSEIF .... ELSEIF ELSE ENDIF is the pattern
You must have a final ELSE before the ENDIF
Thank you for your assistance!
I am having difficulty with this. Invalid type in operator <. Can some one help?
IF ([New WOS after Flush]>[Std+1]) THEN 8000 ELSEIF ([New WOS after Flush]<[Std-1]) THEN 9000 ELSE 5000 ENDIF
or
IF ([New WOS after Flush]>[Std+1]) THEN "Tier3" ELSEIF ([New WOS after Flush]<[Std-1]) THEN "Tier1" ELSE "Tier2" ENDIF
Hi @bayo
Please ensure that the field [New WOS after Flush] and [Std] are both numeric types. The message suggests to me that one or the other isn't.
Hope that helps!
John
@JohnJPS
Yes my error. Thank you
User | Count |
---|---|
19 | |
15 | |
13 | |
9 | |
8 |