Alteryx Designer Desktop Discussions

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

Send each Team's group of records throug a macro

hellyars
13 - Pulsar

Hopefully, this is an easy one.  I have a list of records that can be grouped into various teams.   The input is one large file (not separate files) .  I want to run each TEAM through through  the macro to be processed. How can I do that?

 

 

TEAMDATA1DATA2

BLUE

 

FOOFOO
BLUEFOOFOO
BLUEFOOFOO
BLUEFOOFOO
REDFOOFOO
REDFOOFOO
GREENFOOFOO
PINKFOOFOO

PINK

FOOFOO
REDFOOFOO
REDFOOFOO
REDFOOFOO
REDFOOFOO
REDFOOFOO
REDFOOFOO
ORANGEFOOFOO

ORANGE

FOOFOO

GREEN

FOOFOO

GREEN

FOOFOO

GREEN

FOOFOO

GREEN

FOOFOO

PURLPLE

FOOFOO

TACOS

FOOFOO

TACOS

FOOFOO

TACOS

FOOFOO

 

5 REPLIES 5
AngelosPachis
16 - Nebula

Hi @hellyars ,

 

You are going to need a batch macro for that. First use a  summarize tool to group the different values for the Teams column.

 

AngelosPachis_0-1622482454937.png

 

 

Then you have to create your macro in a new sheet, adding a filter tool after the macro input and connecting it to a control parameter tool.

 

AngelosPachis_0-1622482317506.png

 

What will happen then is that the different values for Teams you got in the summarize tool will be fed one by one in this filter tool. So the first time the batch macro runs, the value would be PINK, the next one ORANGE and so on. Then after your filter tool, you can apply the macro that you want to process your data by.

 

Hope that helps,

 

Angelos 

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Great explanation of batch macros @AngelosPachis!

 

A nice tip is in this case you don't actually need the control parameter, action tool or filter tool. Simply to change the workflow type to a Batch Macro in the workflow configuration!

 

That way you can use the "Group By" element of the macro when it's in the workflow, feeding in (as you have) the summarised list and the standard data.

 

New Batch Macro:

Jonathan-Sherman_1-1622483537460.png

 

Outer Workflow:

Jonathan-Sherman_0-1622483515174.png

 

I've attached an updated workflow for you to see, but both approaches would work @hellyars!

 

Kind regards,

Jonathan

 

hellyars
13 - Pulsar

@AngelosPachisand @Jonathan-Sherman  Thank you.  This is simple and (exactly) to the point.  Its what the doctor ordered.

atcodedog05
22 - Nova
22 - Nova

Hi @Jonathan-Sherman 

 

Till day i had believed control parameter is mandatorily required for a batch macro😅. Until you demystified the myth in this post by showing that its not really the case, batch macro can also be built without control parameter.

 

Thank you for demystifying the myth and giving me a the broader understanding of the concept. 😀

 

Thank you for this new learning. Kudos to you.

Cheers and Happy Analyzing 🙂

danilang
19 - Altair
19 - Altair

Hi @hellyars 

 

You might be able to accomplish this without the use of a macro as well.  You can convert most processes that work with a single Team to handle multiple Teams by "Grouping" by it in the following situations 

 

- add the [Team] field as the top most level in Sort tools,

- add it as a Join field  

- use the grouping functionality in most common common tools, i.e. Summarize, Transpose, Multi-Row, Sample and others

- replace Append tools with Joins on Team, 

- etc

 

There are cases where this won't work, of course, but if you can do it, it avoids having to maintain both the main workflow and the macro. 

 

Dan 

Labels