Replace range of numbers into a string
- 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 I am quite new to Alteryx
I have a lot of rows containing a number between 0-1000
I want to split them up in 3 categories
0-180
180-275
275 or over
with a string on each category. I am really lost on how to solve it.
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You should be able to add a Formula tool to create a new field. A formula along these lines should work :
IF [Number] >= 250 THEN
"Category 3"
ELSEIF [Number] > 180 THEN
"Category 2"
ELSE
"Category 1"
ENDIF
Hope that helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @astro90,
You could use this expression in a formula tool:
IF ToNumber([Value]) >= 275 THEN 'String 1'
ELSEIF ToNumber([Value]) >= 180 THEN 'String 2'
ELSE 'String3'
ENDIF
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Regards,
Jonathan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @astro90
If your category ranges are fixed I'll go certainly with Formula tool here is the syntax :
if [Row Name] < 180 then "Category Name" elseif [Row Name]>= 180 && [Row Name]< 275 then "Category Name" else "Category Name" endif
If you want applicate this formula in multiple fields so you need to use Multi-Field Formula with the bellow syntax:
if [_CurrentField_] < 180 then "Category Name" elseif [_CurrentField_]>= 180 && [_CurrentField_]< 275 then "Category Name" else "Category Name" endif
Hope that's help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you so much!!!
