Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

is it a for loop?

chuntingsimonlo
6 - Meteoroid

chuntingsimonlo_0-1675158015942.png

sorry for the dump question, i am just new to the alteryx and trying to convert this to python code, 
may i know that is it a for loop in the screenshot, cause the output file is not only this 'GCIN" number? thanks. 

3 REPLIES 3
FinnCharlton
13 - Pulsar

Hi @chuntingsimonlo,

This workflow is a 'batch macro', which can definitely act like a 'for loop'. When you put this macro into a workflow, it can pass groups of records through the macro one by one.

The tool right at the top with the cog symbol is a 'control parameter'. This can be used to change the behavior of the workflow based on the records coming through the macro. In this workflow, the value of the control parameter changes the GCIN_2 value used in the filter. So, each set of records passing through the macro is filtered using a different GCIN_2 value, resulting in the multiple GCIN numbers you see in the output.

In python, this could be thought of as a 'for' loop, looping for each of the GCIN_2 values entering the control anchor of the macro (the one with the upside-down question mark ?).

Read more about batch macros here: https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Getting-Started-with-Batch-Macros/t...

DataNath
17 - Castor

Hey @chuntingsimonlo - the presence of a Control Parameter means that the workflow you’re looking at there is a Batch macro. To answer your question, Batch macros are indeed the equivalent of a FOR loop in Alteryx. Outside of the macro, you’ll normally have a list of values that feeds into the Control Parameter, running a single iteration of the macro whilst replacing the target (your filter condition) each time.

chuntingsimonlo
6 - Meteoroid

@FinnCharlton @DataNath Thanks for help.

Labels