Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Apply same Regex on multiple columns

viv_acious
6 - Meteoroid

Hi there,

 

I have been using the Regex Tool (under Parse) to clean up multiple columns that needs cleaning.

I am wondering is there a way to apply the Regex on several columns all at once?

 

For examples, most of the columns should only be an integer value (for scores) however they are coming up as either Dates (e.g. 2017-02-02 when it should be just 2) or even some texts like "10-TEXT=10" which I use regex to turn it into just 10.

 

As you can imagine, to apply the above regex expressions over 20-30 fields are very time consuming/messy.

Surely there is a better way to do this in Alteryx?

 

Thanks,

Viv

7 REPLIES 7
jrgo
14 - Magnetar

@viv_acious,

 

theres 3 regex functions that can be used in a expression builder (Formula). REGEX_MATCH(), REGEX_REPLACE() and REGEX_COUNT(). Use which ever is appropriate in a multi-field formula tool and apply your regex pattern to all the fields you check.

 

Hope this helps!

 

Jimmy

bb213
8 - Asteroid

This does not work for PARSE.  I have to parse 12 different fields - apparently the only solution is to the use the "REGEX" tool under the "Parse" menu 12 times. 

 

davidoc
7 - Meteor
Hi, I have exactly the same problme - did you manage to find a better solution than 1 regex parse per column? Dave
AndrewS
11 - Bolide

Hi, you could try a Transpose followed by one regex on Value, then Cross Tab back?

davidoc
7 - Meteor

sounds interesting - will try when fresh in the morning and let you know 🙂

bb213
8 - Asteroid

@davidoc you can use record id to transpose and then crosstab back. Here is a simple example attached. 

 

davidoc
7 - Meteor
Thanks - the transpose worked well 🙂
Labels