IF Statements with Multiple Conditions
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all,
Beating my head against the wall trying to figure out why this won't work. Using formula to create a new column called Aging for certain records. Past Due column is set to VSTRING and the values range from -40 to 650. This is the formula I created and I'm getting a Parse Error at char(548) Invalid Type in operator >=. (Expression #1) error.
IF [Past Due] <= 0 Then "Current"
elseif ([Past Due]>0 AND [Past Due]<=15) Then "0-15 PCT"
elseif ([Past Due]>=16 AND [Past Due]<=30) Then "16-30 PCT"
elseif ([Past Due]>=31 AND [Past Due]<=60) Then "31-60 PCT"
elseif ([Past Due]>=61 AND [Past Due]<=90) Then "61-90 PCT"
elseif ([Past Due]>=91 AND [Past Due]<=180) Then "91-180 PCT"
elseif ([Past Due]>=181 AND [Past Due]<=365) Then "181-365 PCT"
elseif ([Past Due]>=366 AND [Past Due]<=730) Then "GT 1 Year PCT"
elseif ([Past Due]>=731 AND [Past Due]<=1095) Then "GT 2 Year PCT"
elseif [Past Due]>=1096 Then "GT 3 Year PCT"
else Null()
endif
What am I missing in this syntax? It's telling me the >=1096 is the issue.
Thank you all for your help.
Solved! Go to Solution.
- Labels:
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@krich434 since the[Past Due] is string you need to use the numbers in quotes in the condition IF [Past Due] <= ‘0’ Then "Current" or
use the toNumber([Past Due]) function to convert the [Past Due] value to number
toNumber([Past Due] )<= 0 Then "Current"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you very much! That solved my issue.
