Multi-condition If Statement with a range as a condition
- 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
I have a multi-condition IF formula that needs help. I have a data set that needs to return a label for multiple conditions. My formula is not working when one of the conditions is a range. I would appreciate any advice on how I can improve the formula
Examples:
If the data is between 5 and 10, then "5-10"
If the data is between 11 and 14, then "10-14", Else ">14"
I have tried -, AND, as well as && to define the ranges without success.
Data of 5 or 11, will return the labels, but nothing else in the defined ranges
I would appreciate any advice on how I can improve the formula
- Labels:
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Alteryx doesn't have a Between operator
try:
IF [my field] >= 5 and [my field] <= 10 THEN "5-10"
ELSEIF [my field] >= 11 and [my field] <= 14 THEN "10-14"
ELSE "> 14"
ENDIF
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
See if this works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you, @Felipe_Ribeir0 and @ChrisTX Seems obvious now that I can see it. Appreciate your assistance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @angeline559
I am glad it worked. If you could mark the answers that helped you as a solution, i would be even more glad :).
