I am currently trying to complete a simple age bucketing equation but am receiving a Malformed IF statement error and I am not too sure where I am off. Below is the current equation that I have written out;
IF [DaysOutstanding]=1 then "S1"
else IF [DaysOutstanding]<=7 then "2-7"
else if [DaysOutstanding]<=15 then "8-15"
else if [DaysOutstanding]<=30 then "16-30"
else if [DaysOutstanding]<=60 then "31-60"
else if [DaysOutstanding]<=90 then "61-90"
else if [DaysOutstanding]<=180 then "91-180"
else ">180" ENDIF
Hi @ccarr5 , try deleting the space between the else and if (so they become elseif)
You'll also want to change your data type as well to string/vstring.
Thank you Patrick, an oversight on my part. Unfortunately it resulted in an "Invalid Type in operator <=" error. Any thoughts on what I might be missing here?
Perhaps your [DaysOutstanding] field is not configured as a numeric field? If that's the case, you can add the "ToNumber(" function in your expression so the numeric test ("<=") can take place.
IF ToNumber([DaysOutstanding])=1 then "S1"
elseif ToNumber([DaysOutstanding])<=7 then "2-7"
elseif ToNumber([DaysOutstanding])<=15 then "8-15"
elseif ToNumber([DaysOutstanding])<=30 then "16-30"
elseif ToNumber([DaysOutstanding])<=60 then "31-60"
elseif ToNumber([DaysOutstanding])<=90 then "61-90"
elseif ToNumber([DaysOutstanding])<=180 then "91-180"
else ">180" ENDIF
You might also want to play with the TILE tool with manual tiles.
cheers,
mark