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

Rearrange data

SylviaK
8 - Asteroid

 

Hi, 

 

Can someone please advise how to get from the below Input table to the below Output table?

 

Query.PNG

Many thanks for your help in advance.

7 REPLIES 7
Thableaus
17 - Castor
17 - Castor

Hi @SylviaK 

 

Here's a way of doing. Workflow attached.

 

Split your category column into rows using "," as a delimiter. Use the Data Cleansing to remove extra whitespaces. Use the Summarize tool to Group by Category and do the count.

 

Thableaus_0-1593011040282.png

 


Cheers,

JReid
9 - Comet

This was a nice quick challenge. Parse tools are one of the biggest hurdles, but most useful tools in Alteryx.

 

I think the attached file has the solution you're looking for!

 

EDIT: ahh @Thableaus beat me to it. Same solution too!

SylviaK
8 - Asteroid

Thank you Thableaus. It works perfectly. 

 

However, just realised that my data is in this format, so separating by comma doesn't work. Any ideas?

 

Query.PNG

Thableaus
17 - Castor
17 - Castor

@SylviaK 

 

Try using this option in the Text to Columns tool.

 

Thableaus_0-1593022746327.png

 

 

It will ignore any delimiters found inside quotes.

 

Cheers,

SylviaK
8 - Asteroid

Brilliant. That works. 

 

after the data into rows, would like to get rid of the quotes around my category. how do I do that?

Thableaus
17 - Castor
17 - Castor

@SylviaK 

 

Use the Replace expression. Add a formula tool. Add this expression:

 

Replace ([Category], '"', "")

 

You would be replacing quotes for nothing.

 

Cheers,

SylviaK
8 - Asteroid

many thanks @Thableaus 

Labels