We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Iterative Macro - part of data not to loop back in next iteration

Badeagabriela97
6 - Meteoroid

Hi,

 

I want to build an Iterative macro so I can repeat a filtering process.

 

At each iteration I group data by each column of file and where sum of Amount is null I map with Yes/No on a Net-off column.

Badeagabriela97_0-1752502968550.png

 

My problem is I want part of data with flag of "Yes" on Net-off column to filter out at each iteration and not to loop back at the next iteration. 

 

Is it a way that I can achieve this, please?

7 REPLIES 7
abacon
12 - Quasar

@Badeagabriela97 It is definitely possible.

 

Are you able to post the macro with dummy data? I see you have a filter on your data that I assume isn't getting the desired result making it hard to troubleshoot your problem without seeing the actual macro.

 

Bacon

Badeagabriela97
6 - Meteoroid

Here it is. Please help. The idea is that I don't want to have duplicates in macro's output, so it needs that each iteration checks only the data filtered from the last one.

Badeagabriela97
6 - Meteoroid

What I want:

 

Columns in data: 

Badeagabriela97_0-1752505138911.png

 

1st iteration:

Badeagabriela97_1-1752505228928.png

 

2nd iteration:

Badeagabriela97_2-1752505328617.png

 

Now the output of macro gives doubled entries:

Badeagabriela97_3-1752505386079.png

 

abacon
12 - Quasar

@Badeagabriela97 Did you mean to build an iterative macro or a batch macro? Using control parameters make it a batch macro, meaning it will run over the entire dataset for each record fed into the control parameter.

 

Bacon

abacon
12 - Quasar

@Badeagabriela97 Additionally, it is not very clear what you are trying to accomplish with this workflow.

 

However, the reason the macro is doubling records is because it's a batch macro and not an iterative macro. Meaning for each record fed into the control parameter (in this case 3 records), the macro will run. It is not a iterating through the data and ending when a condition is met.

 

Bacon

Badeagabriela97
6 - Meteoroid

But how can I transform it in an iterative macro that runs for each column of the file, please?

Gaurav_Dhama_
12 - Quasar

Here you go, I changed the approach completely.

Removed the batch macro and just used Iterative macro. I tested it with few scenarios, and it worked. Check it out.

 

Mark it as solution if this solved your problem.

Labels
Top Solution Authors