We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Looking for a way to input groups of data into a batch macro and process each group

jaiwalke
5 - Atom

Hi everyone,

I'm currently working through a large data set (300k rows) and and I've managed to group unique identifiers towards a record ID for example:

IDKey valuesdata 1 data 2 
1abc

4352

Alaska
1abc500Ohio
2xyz6453New Jersey 
2xyz48489New Jersey 
3jkl845Colorado
3jkl2354California

 

I'm currently trying to process each of these to a batch macro to output each set of ID which are the same as separate records for example:

IDKey valuesdata 1 data 2 
1abc

4352

Alaska
1abc500Ohio

 

My current theoretical solution would be to iterate through each record, but I'm not sure where I'd begin. Any help would be appreciated, thank you!

4 REPLIES 4
SPetrie
13 - Pulsar

Hello! Can you elaborate a bit more on what you mean by separate records? Are you trying to get all ID 1s into their own file or is something else going on?

What is your goal here?  A batch macro may be a bit much depending on where you are taking this.

jaiwalke
5 - Atom

Hi SPetrie, I'm looking to get all record 1s to one file, record 2s to another, etc. 

The current goal is to break up a large input file into smaller files to use downstream. For example, record 1 would have 100 entries with the ID 1. These files will then be used for a separate work flow after this data split occurs. 

SPetrie
13 - Pulsar

Thanks for the clarification!

You can use a batch macro to do this, but I think it may be a bit overkill.

Since you already have an ID that indicates which items are to be split up into different files, you can use that field to generate a name column and have an output tool do the splitting for you.

A formula such as ".\MyFile-"+ToString([ID])+".xlsx|||sheet1" for example, would create an excel file called MyFile-## for each ID it found and would only have those ID items in them.

I attached an example workflow showing this method.

 

jaiwalke
5 - Atom

Thanks for the solution, I didn't even considering directly outputting the data. I'll give it a go and reply if I get any other issues!

Labels
Top Solution Authors