Alteryx Designer Desktop Discussions

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

Batch Macro for One file that contains duplicate columns?

kkkim
8 - Asteroid

Hi, Everyone!

 

I am looking for some help with batch macro. Wondering if attached can be made into a macro. Basically, it's one file that contains extracts of multiple tables. I need to consolidate all the tables and transpose the data into one table containing multiple values. 

 

To achieve this, I used unique tool to filter columns (since same column headers are used for all tables), and repeat transpose for each then union them... 

 

Wanted to know if there is a more efficient way of doing this.

 

Thank you!

 

Capture.PNG

10 REPLIES 10
SPetrie
12 - Quasar

Can it be made into a macro, yes. Im not entirely sure I understand they why part of what you are doing, but the steps can be made into a macro. Are you able to share this portion of your workflow with some sample data to look at?

kkkim
8 - Asteroid

Thank you for your response! Attached a sample data set for review. :)

SPetrie
12 - Quasar

Can you also attach the workflow so I can see how you are doing your transpose and cross tab setups.

kkkim
8 - Asteroid

Yes! Attaching sample output. Thank you for your help!

SPetrie
12 - Quasar

Rather than a batch macro, I think an iterative macro may be a better solution for you.

Im still not 100% clear on what the data is supposed to be doing, but I think I got enough here for you to be able to alter it and make it your own.

SPetrie_0-1658510784443.png

 

SPetrie_2-1658510906171.png

SPetrie_1-1658510868733.png

SPetrie_3-1658510972208.png

 

Basically, its doing what your original image shows. It takes the unique values, transforms them with transpose and crosstab and sends them to the main output.

The items that come out of the duplicate anchor are sent to the Leftovers output to be sent into the input again. Its set to iterate up to 100 times but that can be increased if needed. If it finished before it hits 100 it will just stop early.

kkkim
8 - Asteroid

Thank you so much for this! This is amazing!!! I will definitely play around with this and get back to you with any questions if I have any!

 

Thank you!!!

kkkim
8 - Asteroid

Unfortunately, the file is not opening for me. Can you attach them in yxmd format? Thanks so much!!!!

SPetrie
12 - Quasar

Here you go

kkkim
8 - Asteroid

Thank you ever so much! I got this done!!!

Labels