Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Replace a range of Numbers

rwicker
7 - Meteor

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.

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

EDIT: I misread the post. Follow @MarqueeCrew's instructions.

MarqueeCrew
20 - Arcturus
20 - Arcturus
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
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
rwicker
7 - Meteor

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

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
Labels
Top Solution Authors