Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Adding "_" delimiter between lower case and upper case

cmyer
6 - Meteoroid

Hi Alteryx Community, 

 

I am trying to change the format of my values. 

 

For example-my current field looks something like this:

 

Column

ValueNumberOne

ValueNumberTwo

ValueNumberThree

 

I would like to change the values in that column to have a "_" between each word as such:

Column

Value_Number_One

Value_Number_Two

Value_Number_Three

 

please note: my values are not all equal length 

 

Does anyone know how to achieve this? 

7 REPLIES 7
joshuaburkhow
ACE Emeritus
ACE Emeritus

Hey @cmyer 

 

I use a version of what @Jonathan-Sherman  uses here: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/split-by-upper-case-before-lower-case/...

 

 

 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
MarqueeCrew
20 - Arcturus
20 - Arcturus

@cmyer ,

 

I don't know how @joshuaburkhow solved this (I haven't looked), but this is how I would:

 

Use a RegEx tool to find the switch in case and tokenize the data.  Then use a Summarize tool to rebuild.

 

capture.png

Cheers,

 

Mark

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MarqueeCrew
20 - Arcturus
20 - Arcturus

@joshuaburkhow ,

 

OMG!  How impressive to use so many tools.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
atcodedog05
22 - Nova
22 - Nova

Hi @cmyer

 

Here is a workflow for the task.

Formula

 

 

REGEX_Replace([Text], "(\l)(\u)", "$1_$2",0)

 

\l - lower case

\u - uppercase

adding _ between them

0 - case sensitive search

 

 

Output:

atcodedog05_0-1605814005999.png

Workflow:

atcodedog05_1-1605814018274.png

 

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

MarqueeCrew
20 - Arcturus
20 - Arcturus

Maybe he'll mark all as solutions, but only give likes to me. 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
cmyer
6 - Meteoroid

*She marked all as solutions lol

 

YOU GUYS ARE GREAT!!! 

 

thank you so much 🙂

atcodedog05
22 - Nova
22 - Nova

Happy to help 🙂 @cmyer 

 

Cheers and Happy Analysing 😀

 

Feel free to reach out if you face any issues 🙂

Labels