Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need help - multiple columns to rows

Bo_Zhang
5 - Atom

Hi Community,

 

I am stuck on a problem and would like to know if anyone has some ideas.

I have a set of sales records from different stores, and I consolidate those into one sheet (see the Source Data tab) through macro.

Bo_Zhang_0-1675179355302.png

 

Then, to have further analysis, I need the data laid out by store, location and year (see the Target tab). 

Bo_Zhang_1-1675179373169.png

 

I tried transpose; however, the location and amount were treated separately, and it was hard to distinguish which data was for which year.

Thanks in advance.!

3 REPLIES 3
FinnCharlton
13 - Pulsar

Hi @Bo_Zhang , here is a solution that should work for any number of store names, using a batch macro:

FinnCharlton_0-1675181962018.png

Here is inside the macro:

FinnCharlton_1-1675181984467.png

Christina_H
14 - Magnetar

If possible, I would recommend changing the process you're using to consolidate the data so that you get cleaner data.  However, the attached gives the output you're looking for.

Christina_H_0-1675182284563.png

Bo_Zhang
5 - Atom

Thank you, @FinnCharlton and @Christina_H! Both solutions worked perfectly. 

Labels
Top Solution Authors