SOLVED
Replace a range of Numbers
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
rwicker
7 - Meteor
‎03-18-2019
01:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello!
I have a column that has type Int 64. I need to replace all the numbers that are =>5 with a 5+. I keep getting errors or when using an IIF it is replacing all the numbers in that column.
Solved! Go to Solution.
Labels:
- Labels:
- Preparation
4 REPLIES 4
17 - Castor
‎03-18-2019
01:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
EDIT: I misread the post. Follow @MarqueeCrew's instructions.
20 - Arcturus
‎03-18-2019
02:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here's the issue: an integer only holds the values 0-9. That plus sign means that you're working with a string. So you can either use a select beforehand and change to a string or create a new string variable.
IIF(tostring([intVar]>5,"5+",[intVar])
Cheers,
Mark
IIF(tostring([intVar]>5,"5+",[intVar])
Cheers,
Mark
Alteryx ACE & Top Community Contributor
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
‎03-22-2019
06:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Mark!
I am getting Malformed IF Statement with this.
IIF(tostring([Not Processed Days From Received to Today]>5,"5+",[Not Processed Days From Received to Today])
Thanks!
tom_montpool
12 - Quasar
‎03-22-2019
06:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
If I assume that your [Not Processed Days From Received to Today] variable is a string, your IIF statement should be:
IIF(ToNumber([Not Processed Days From Received to Today])>5,"5+",[Not Processed Days From Received to Today])
Alternatively:
IF ToNumber([Not Processed Days From Received to Today])>5 THEN "5+" ELSE [Not Processed Days From Received to Today] ENDIF
