Alteryx Designer Desktop Discussions

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

Run a Macro n times utilizing the macro result as the input to itself

matcarvalho
6 - Meteoroid

I am creating a Project Management tool that calculates Planned start/due dates based on its dependencies. They way the tool is currently designed, I am looking to find a way that the tool is able to utilize the result from the macro to recalculate dynamically (based on the amount of rows) so for each time it runs, there will be new populated fields.

 

The problem is that if allow the flow to only run the macro batch one time( It will only bring the values based out of the original populated values and so everything else below still remains blank - not desired)

 

 

I am uploading the file for clear understanding. But the desired state it would be something like this:

 

Pre-Iteration (Note that I calculated the first row prior to executing the Macro)

IDTaskDurationDependencyPlanned Start DatePlanned Due date
1Task 12 09/14/202009/16/2020
2Task 221  
3Task 322  

 

Iteration 1

IDTaskDurationDependencyPlanned Start DatePlanned Due date
1Task 12 09/14/202009/16/2020
2Task 22109/16/2020 
3Task 322  

 

Iteration 2

IDTaskDurationDependencyPlanned Start DatePlanned Due date
1Task 12 09/14/202009/16/2020
2Task 22109/16/202009/17/2020
3Task 32209/17/2020 

 

Iteration 3

IDTaskDurationDependencyPlanned Start DatePlanned Due date
1Task 12 09/14/202009/16/2020
2Task 22109/16/202009/17/2020
3Task 32209/17/202009/19/2020
2 REPLIES 2
T_Willins
14 - Magnetar
14 - Magnetar

Hi @matcarvalho,

 

I think an iterative macro may work better than a batch macro.  Each iteration joins the Dependency to the ID, then copies the Planned Due date from the ID (parent) to the Planned Start Date of the Dependency (child).  I use variants of this type of macro to roll up trial balances from accounts to parent nodes.

 

Iterative MacroIterative Macro

 

ResultsResults

 

matcarvalho
6 - Meteoroid

Thank you so much! That is really helpful. I am going to do some research here, because even though I can see your model works, I still don't fully understand how iterative macro works.

 

Next Step: Study Iterative Macro.

 

Thank you! I really appreciate it.

Labels