Alteryx Designer Desktop Discussions

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

Union dataset return from batch macro output

aeolus187
8 - Asteroid

Hi Alteryx engineer,

 

My case is i will use batch macro to pass date to create dataset, and the dataset is return by macro output, 

i want to join or union the dataset return by each iteration. how can I implement it?

 

 

10 REPLIES 10
DataNath
17 - Castor

For batch macros you can union your macro outputs. In the interface designer (Ctrl+Alt+D), you can change the union (in the properties tab) and set your results to union based on field names/position etc depending on the requirement.

 

For a more detailed response, are you able to provide any extra info about outputs? Perhaps some screenshots/sample data so we can help you find the best solution.

Qiu
21 - Polaris
21 - Polaris

@aeolus187 
I believe by design, the results coming out from a batch macro will be "union" together.

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Getting-Started-with-Batch-Macros/t...

aeolus187
8 - Asteroid

@DataNath 
yup i see Union works for that,  what if i want the dataset append, how can i implement this? I want to join the dataset in position

aeolus187
8 - Asteroid

@Qiu 

 

yup you are right, what if i want to join the each iteration dataset like below?

 

IT1IT2IT3
ABFE
CDD
DFX

 

 

DataNath
17 - Castor

@aeolus187 can you provide a sample/screenshot of your exact inputs and expected outputs? I'd imagine it's certainly possible but hard to know which approach to take without seeing the schema etc.

 

If your data is sensitive then a dummy will do.

 

I've attached a potential solution, depending on whether or not your iteration outputs are similar to how I assume they may look.

 

DataNath_1-1652087464402.png

 

aeolus187
8 - Asteroid

yup this is my workflow and here is my expected result looks like

aeolus187_0-1652087514020.png

 

DataNath
17 - Castor

If each unioned result has a unique identifier throughout then you could add the solution in my last reply to your macro output, grouping by that in your multi-row and then using that for your headers in the cross tab.

aeolus187
8 - Asteroid

@DataNath 

 

the concept is cool, and i added the Field ID , but how can i get the iteration number from batch macro?

DataNath
17 - Castor

Sorry I just used Iteration # in my example but in your case I think you should be able to use the SheetName of the sheets that you're stacking on top of each other as your unique identifier (where I've used Iteration #) and then follow the steps from there.

Labels