Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

How to convert header into row values and split header also into row values

Anuj_saxena01
6 - Meteoroid

Hi Experts , I am new to alteryx. so seeking for a quick help for a scenario. Thanks in advance. Here is my scenario-

I need to convert Table 1 into table 2. Here column like Jan(Fore),Jan(Current) etc. needs to be converted into rows (and as a new column i.e. Month and Time). Is there a way to do so in alteryx. Please help, Its urgent.

Table 1

GroupJan (Fore)Jan (Current)Feb (Fore)Feb (Current)Mar (Fore)Mar (Current)
ABC$1,234$2,123$2,456$2,457$2,458$2,459
ABCD$1,235$2,124$2,456$2,457$2,458$2,459
XYZ$1,236$2,125$2,456$2,457$2,458$2,459
XYZX$1,237$2,126$2,456$2,457$2,458$2,459

 

Table 2

GroupMonthTimeSale
ABCJanCurrent$2,123
ABCFebCurrent$2,457
ABCMarCurrent$2,459
ABCJanFore$1,234
ABCFebFore$2,456
ABCMarFore$2,458
ABCDJanCurrent$2,124
ABCDFebCurrent$2,457
ABCDMarCurrent$2,459
ABCDJanFore$1,235
ABCDFebFore$2,456
ABCDMarFore$2,458
2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @Anuj_saxena01 

 

This is how you can do it.

 

Workflow:

atcodedog05_0-1621330980299.png

1. Use transpose tool with Group as key to convert columns to row.

2. Use Regex parse mode to split Jan (Fore) into different columns.

3. Select tool to rename.

 

Here is a resource on 

Transpose tool : https://community.alteryx.com/t5/Interactive-Lessons/Changing-Data-Layouts/ta-p/82876

Regex tool parse mode : https://community.alteryx.com/t5/Interactive-Lessons/Parsing-Data-with-RegEx/ta-p/441415

 

Hope this helps 🙂

Anuj_saxena01
6 - Meteoroid

Thanks a lot for the quick response. It helped. @atcodedog05 

Labels