Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Looping in Alteryx

TDevrie6
5 - Atom

Hi community,

 

In Alteryx I tried to rebuild a logic that you can find attached in my Excel file under the tab scenario.Mainly it needs to recalculate different variables over a certain time horizon. Variables first need to be calculated for T1 (time 1) and are used as an input for T2 and so on. I was wanting to work in Alteryx with a multifield formula, but it seems not possible to calculate multiple variables with the same tool. However then I chose for the most easy (but cumbersome) solution and copied all my tool for T2 to T3/T4/T5,..

 

LOOP2.PNG

 

Is there not an easy way to loop through the same tools (instead of copying) in a certain way (macro output tool?) & how exacty? I also attached my Alteryx workflow.

 

LOOP.PNG

 

Cheers,

 

Tom

3 REPLIES 3
meads
7 - Meteor

Hi Tom, 

 

You are on the right track it seems, and you identified a use case for a macro which is sometimes the hardest part. From your post, it sounds like you are looking for whats called a Batch Macro in Alteryx, where you can loop through a set of values and perform logic on each value being looped through, in your case the recalculation. I have shared a link to batch macros, let me know if you have any specific questions.

 

Alteryx: Batch Macro

Batch Macro Tech Details

estherb47
15 - Aurora
15 - Aurora

Hi @TDevrie6 

 

I'm thinking macro as well, but perhaps an Iterative macro instead. You'll need to loop a number of rows through the process together, not just one line at a time.

 

https://community.alteryx.com/t5/Alteryx-Knowledge-Base/How-create-an-Iterative-Macro-The-Collatz-Co...

 

Let me know if this helps.

 

Cheers!

Esther

TDevrie6
5 - Atom

Hi Esther,

 

Thanks a lot! Iterative Macro was indeed the solution for my use case! 🙂

 

I do not know if you have experience with the Alteryx workflow, but I was wondering if you would know if it is possible to upload a workflow with a macro to the Gallery? If yes, the iterative macro also needs to be added to the Gallery next to the workflow?

Labels