Union dataset return from batch macro output
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
Solved! Go to Solution.
- Labels:
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@aeolus187
I believe by design, the results coming out from a batch macro will be "union" together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
yup you are right, what if i want to join the each iteration dataset like below?
IT1 | IT2 | IT3 |
AB | F | E |
C | D | D |
D | F | X |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
the concept is cool, and i added the Field ID , but how can i get the iteration number from batch macro?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
