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

Alteryx Batch Macro Loop

DelData
8 - Asteroid

Hi There.....

 

can you help.....i have data where i can only extract a certain number of rows per workflow run...

 

Therefore i need to run the same workflow multiple times and union each run/loop together to get all data...see below....

output required.png


Ideally i want a macro to be able to feed in the input and number of loops count and then produce the output...


I want to go from Before to After......and need help to create a batch marco to loop the input the number of times i want

Before workflow attached.....I need the After Workflow as answer........ 

 

macro loop before after.png

11 REPLIES 11
OTrieger
12 - Quasar

@DelData 

What is your question?

DelData
8 - Asteroid

How do i create a batch marco to loop the input the number of times i want?

Mathias_Nielsen
9 - Comet

Hi @DelData,

 

Have you tried generate rows?

Just change the number at the red arrow.

 

Hope this helped

OTrieger
12 - Quasar

@DelData 
Watch the Macros interactive lesson, it will give you a good idea on what to do.

DelData
8 - Asteroid

no.....what i am after is help for someone to show me how to create a batch macro to push the same input file in a set number of times....this is what will help me

DelData
8 - Asteroid

no.....what i am after is help for someone to show me how to create a macro to push the same input file in a set number of times....this is what will help me

Mathias_Nielsen
9 - Comet

Can you explain why you need the same file multiple times? You said you can only extract a certain number of rows.

I know in an excel file you can take only a certain range, you could modify the range for each run if that's what you want.

DelData
8 - Asteroid

if the server says i can get 1000 rows of data and the total rows is 4000

then i need to run my workflow 3 times...I will send request to server and all i will update the row numbers i need to grab...show in bue below

 

loop1 = rows 1-1000

loop2 = rows 2000-3000

loop3 = rows 3000-4000

Mathias_Nielsen
9 - Comet

I see, the batch macro will automtically union the data together before output. Just make sure that each of the "loops" have a unique identifier, as the control parameter of a batch macro will be used to group the data by. So each of your queries will have to be tied to that control parameter/loop. So basically like you have shown there in the blue where they are in their own record. I would personally split it like this:

loop1 | 1 | 1000

loop2 | 1001 | 2000

So that there are three columns that should make it easier to replace the ranges in your quuery. Choose the "loop" column as the control parameter and you should be a long ways with your macro :)

Labels