Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Loop to find best fit

tonypreece
10 - Fireball

Hey guys.

I'm trying to replicate an Excel based Erlang calculator in Alteryx. Erlang is a formula to identify the number of staff needed in a call center to handle the expected volume of calls while maintaining a target service level.  I'm almost there, but need some help looping through the workflow. 

 

My input data shows the number of calls expected (offered) by half hour intervals and then calculates the number of agents needed to answer them. 

 

tonyp_0-1577218597369.png

 

The next step is where I'm struggling. I need to check the Service Level (SL) against the Required Service Level (RSL) and if SL < RSL then add one to the number of agents required and run through the formula again, until SL >= RSL, looping as in the screenshot below.

 

tonyp_1-1577218860025.png

2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hi @tonypreece ,

 

Attached is the workflow you've created and a iterative macro that does the job!

So first I needed to copy the part you wanted to iterate and put inside an iterative macro and configure as one. Also I'm using the constant iterationNumber to add a Agent for each iteration it runs.

fmvizcaino_0-1577223069538.png

 

Second, I needed to open the interface designer (tab View > Interface Designer) and configure the iterative macro. By standards a iterative macro needs to have at least one input macro tool and two output macro tools where one of those outputs will feedback the input during the iterations. Configuration below:

Input1 will receive the data from Iterative and I configure to have the max of 100 iterations.

fmvizcaino_1-1577223253495.png

 

That is it!! If you want to learn more about iterative macros, see the link below:

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Getting-Started-with-Iterative-Macr...

 

Please keep both files in the same folder to make it work. And if you want to add the macro to other workflows, right-click in the blank part of the canvas, select macro.. and search for the macro.

fmvizcaino_2-1577223553395.png

 

Let me know if that works for you.

Best,

Fernando Vizcaino

tonypreece
10 - Fireball

Thanks @fmvizcaino, that worked a treat.

I knew the iterative macro was the way to do it, just couldn't make it happen!

Labels