Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

filter out only numbers then add prefix

BosKev
8 - Asteroid

Hi All,

 

how do I do a formula IF statement where I want it to filter out only numbers in a field , if its true add a prefix to it?

 Thanks.

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

If

Regex_countmatches([field],"\d")) >0 then "prefix" + [field]
else

[field]
endif

 

 this quick formula should help you. 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
joshuaburkhow
ACE Emeritus
ACE Emeritus

You'll want to use the isnumber() function to check in the custom filter. You don't need an IF statement. Just remember what ever you write needs to resolve to either True or False. So something like this:

 

IsNumber([Field Name]) 

 

Hope this helps. If it does please make sure to mark as solved so others can find it on the community!

 

Thanks

Joshua

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
joshuaburkhow
ACE Emeritus
ACE Emeritus

Actually @MarqueeCrew made me realize I missed a step. If you want to Filter then you can use my path but if you just want to add a prefix to specifc records then you actually don't need to really filter the records, just use what Mark gave you and update the values.....

 

Just trying to be clear 😉  

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
BosKev
8 - Asteroid

Thanks both for the quick reply...works great.

Labels