Alteryx Designer Desktop Discussions

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

To Loop or not to Loop?

stevehughes
7 - Meteor

Hi All ,

 

2 days into my Alteryx journey so apols for the stupid questions. I've got a data set that contains [store] [product] [product sales] and a whole bunch of [store attributes]. I want to train a model per product, save them, and then use them for scoring for later on. I've got the knack of doing it for one product but I need something akin to a loop to go through every product, create the models, save them, and then score for new stores later. I cant quite get my head around the macro stuff which I presume I need? In knime, it was a simple matter of setting up a loop by group node. Any idea what I need to do here?

 

The store attributes are just that - they never change regardless of what product is being analysed.

 

Many Thanks

Steve

 

 

4 REPLIES 4
mbarone
16 - Nebula
16 - Nebula

Hi @stevehughes !

 

No stupid questions here!  Sound like you'll want a batch macro, where you feed in a list of "something", and for each value in that list, a certain workflow is performed.

 

For example, you have a list of your attributes, and feed in attribute #1, do "a thing" to it, then repeat for attribute #2.  And so on until the end of your list.

 

Attached is a very simple example.  There's the batch macro (YXMC1) and the workflow where you feed your list into it (YXMD1).

 

This should get you started.  If you search "batch macro" in the Academy section, you'll find some good tutorials as well.

Let me know if you have any questions!

MichaelLaRose
10 - Fireball

Hi Steve,

 

You could use Batch Macro https://help.alteryx.com/2018.2/BatchMacro.htm.

 

Essentially it lets you create a sub-workflow that repeats for each unique item. In your case Products.

 

The macro itself should be your model.

 

Best,

Michael

stevehughes
7 - Meteor

Many thanks! It was the splitting it across two modules that caught me out. Mystery solved.......

mbarone
16 - Nebula
16 - Nebula

Very welcome!

Labels