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

Passing a row_count value as an iteration number

Teresa31
6 - Meteoroid

Hi,

 

I would like to know whether it would be possible to change iteration number in accordance with the chosen file. 

 

My first attempt was to connect 'file browse' tool to 'drop down' tool, so that the number of records within the file would be input as the iteration number. However this does not seem to change the iteration number. 

 

Any help would be greatly appreciated! 

 

Teresa31_0-1614755835811.png

 

6 REPLIES 6
Qiu
20 - Arcturus
20 - Arcturus

@Teresa31 

I believe we need to move the Interface Tools outside of the Macro.

And A batch macro is the one we should use?

Attached is only a sample.

Capturef1.PNG

Teresa31
6 - Meteoroid

Hi @Qiu,

 

Sorry for not catching up with our previous question, but I did take a look and found that iterative macro would better serve the intended purpose rather than batch macro.

 

So.. I was wondering if it would be possible to pass the row count as an iteration number outside the macro as you mentioned.

 

Many thanks!


 

Qiu
20 - Arcturus
20 - Arcturus

@Teresa31 

Can you check if this works for you. Please note it is just the idea, and you need to fine tune it into your really work process.

Capturef2.PNG

danilang
19 - Altair
19 - Altair

Hi @Teresa31 

 

It's not possible to change the Engine.IterationNumber.  It starts at 0 and is incremented by 1 each iteration.  What you can do is change the filter where you're checking it.  Instead of [Engine.IterationNumber]+2=7, use something like [Engine.IterationNumber]+[Offset]=7.  Pass [Offset] into your macro, allowing to you control when the filter condition is met.  

 

Dan

Teresa31
6 - Meteoroid

Hi @danilang

 

Thank you for the reply! Maybe I was a bit misleading, I wanted to update max iteration number, not each engine iteration number (as highlighted below).

 

Teresa31_0-1614778953661.png



@Qiu , Thank you for your response as well. I am taking a look at your workflow and this taught me that iterative macros can take in more than one macro input. I am still in the process of incorporating this idea into the intended workflow. 

danilang
19 - Altair
19 - Altair

Hi @Teresa31 

 

There's no way to update the max iteration number, either.  However, there are 2 stopping conditions for an iterative macro

 

1. Max iterations is reached.

2. The Iterative Output has 0 records

 

The second way is the one you want to look into.  In your macro use [Engine.IterationNumber]<[MaxIterations]-1 in a filter to control whether or not to pass any records to the iterative output.  See the attached for an example

 

Dan

Labels