community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE

Logic to loop within Alteryx

Meteoroid

Hi Experts,

 

I am trying to implement this logic in Alteryx and not able to get perfect output as per my requirement.

Appreciate your help in this.

Let's say I have forecasted data for 13 weeks as below:

WeekForecast
W0113
W0214
W0315
W0412
W0515
W0634
W0723
W0821
W0923
W1011
W1122
W1212
W1310

 

Now based on my inventory and backlog orders I have to adjust this forecast.

For example if Total Adjustment = 20 (means I have 20 backlog orders), my forecast will change to:

WeekForecast 
W013313+20
W0214 
W0315 
W0412 
W0515 
W0634 
W0723 
W0821 
W0923 
W1011 
W1122 
W1212 
W1310 

 

But if the total adjustment = -50 (I have 50 products in my inventory) then output should be as follows

WeekForecast
W010
W020
W030
W044
W0515
W0634
W0723
W0821
W0923
W1011
W1122
W1212
W1310

 

Below is the explanation to come with the output above

WeekForecastNew Expected ForecastAdjustment = Adjustment - Forecast
W0113050-13=37
W0214037-14 = 23
W0315023-15=8
W041248-12 =  -4
W051515 
W063434 
W072323 
W082121 
W092323 
W101111 
W112222 
W121212 
W131010 

 

Doing this in code is easy, we can write for or while loop, but I am unable to achieve the same in Alteryx.

Please let me know in case of any queries.

Looking forward for some answers.

 

Regards,

RD

Meteoroid

Didn't get you?

Alteryx Certified Partner

Hi @roopad,

 

Here's a possible solution that wouldn't require an iterative macro. It still may require a few tweaks, but this should, at least, get you started.

 

Sorry for not including any explanation... it's late in the day and heading home. If you have questions, let me know and I'll respond when possible.

Jimmy
Teknion Data Solutions

Labels