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

Parse Questions in a Column

jmckenna97
8 - Asteroid

Hello

 

Could anyone help with the below?

 

Basically need to create a new column when a number occurs!

 

 

Input 

jmckenna72_0-1597141624082.png

 

 

Expected Output

jmckenna72_1-1597141650139.png

 

Cheers

 

4 REPLIES 4
ChrisTX
15 - Aurora

Try the RegEx tool with Output Method = Tokenize

 

Regular Expression = (.*?Question)

 

ChrisTX_0-1597147077153.png

 

Chris

 

ImadZidan
12 - Quasar

Hello,

 

Many questions around this to give you the right answer. Questions like, is it always 3 questions? is it always the word Question? etc

 

To answer your specific question with your specific example.

@ChrisTX  has given you the tool to use. I would say the regular expression is something like 

 

\d+.\d+\s*[[:alpha:]]+

 

The above looks for one or more digits, separated by a dot, followed by one or more digits etc.

 

I used alpha for any letter, you can use other. this is more generic

 

I hope this helps.

BrianR
Alteryx
Alteryx

In addition to the great suggestions by both @ChrisTX @and@ImadZidan, another question that came to mind was a situation where you might have more questions for a given entity. For example, 4 questions for Entity 1, 5 for Entity 2, etc. I took ChrisTX's workflow, and added a bit to it to account for situations like this. The main change is a "Split to Rows" in the same RegEx tool, and some formulas to create some formatted column names, and then finally a CrossTab to pivot the table back into shape.

 

 

ImadZidan
12 - Quasar

Spot on @BrianR . This is, I would say a complete solution.

 

Perfect!!

Labels