Hi everyone!
I have below code which is written in SAS.

It is basically a loop which is looping from start_curve column to end_curve column. cal_day column is being incremented every time.
I have 366 columns named as days_calls1, day_calls2,...., day_calls_366.
I have 90 columns named as dayPct1, dayPct2, .......day_pct90.
How would I be able to achieve the same functionality in Alteryx?
Any ideas would be appreciated.
Input data would be as below:
cal_day is 1 in the input.
| start_curve | cal_day | end_curve | day_calls1 | day_calls2 | day_calls3 | day_calls4 | day_calls5 | TotalCalls | dayPct1 | dayPct2 | dayPct3 | dayPct4 | dayPct5 |
| 3 | 1 | 5 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | 3 | 5 | 7 | 9 |
| 3 | 1 | 5 | 0 | 0 | 0 | 0 | 0 | 20 | 1 | 3 | 5 | 7 | 9 |
| 3 | 1 | 5 | 0 | 0 | 0 | 0 | 0 | 30 | 1 | 3 | 5 | 7 | 9 |
| 1 | 1 | 4 | 0 | 0 | 0 | 0 | 0 | 40 | 2 | 4 | 6 | 8 | 10 |
| 1 | 1 | 4 | 0 | 0 | 0 | 0 | 0 | 50 | 2 | 4 | 6 | 8 | 10 |
Output would look like this:
You can ignore cal_day of the output. It is being updated after every loop and more or less basically means how many times loop ran.
Values from 1st to 3rd row for days_calls is calculated using dayPct3, dayPct4, dayPct5 as start_curve is 3 and end_curve is 5. (e.g. day_calls1 = totalCalls * dayPct3)
Values from 4th to 5th row for days_calls is calculated using dayPct1, dayPct2, dayPct3, dayPc4 as start_curve is 1 and end_curve is 4. (e.g. day_calls1 = totalCalls * dayPct1)
| start_curve | cal_day | end_curve | day_calls1 | day_calls2 | day_calls3 | day_calls4 | day_calls5 | TotalCalls | dayPct1 | dayPct2 | dayPct3 | dayPct4 | dayPct5 |
| 3 | 4 | 5 | 50 | 70 | 90 | 0 | 0 | 10 | 1 | 3 | 5 | 7 | 9 |
| 3 | 4 | 5 | 100 | 140 | 180 | 0 | 0 | 20 | 1 | 3 | 5 | 7 | 9 |
| 3 | 4 | 5 | 150 | 210 | 270 | 0 | 0 | 30 | 1 | 3 | 5 | 7 | 9 |
| 1 | 5 | 4 | 80 | 160 | 240 | 320 | 0 | 40 | 2 | 4 | 6 | 8 | 10 |
| 1 | 5 | 4 | 100 | 200 | 300 | 400 | 0 | 50 | 2 | 4 | 6 | 8 | 10 |