Hi
I have an input data like below
| Name | ID | Score1 | Score2 | Total |
| J | 245 | 12 | 23 | 35 |
i am passing this into an R code in alteryx workflow and i use randomly generated weights to calculate weighted total. Now i would like to run the R code 10 times, each time generating new random weights and calculate 10 weighted total, then calculate the lowest weight and output it as final result.
my desired output
| Name | ID | Score1 | Score2 | Total | weighted total |
| J | 245 | 12 | 23 | 35 | 14.3 |
| J | 245 | 12 | 23 | 35 | 9.9 |
| J | 245 | 12 | 23 | 35 | 16.1 |
| J | 245 | 12 | 23 | 35 | 10.5 |
| J | 245 | 12 | 23 | 35 | 12.2 |
| J | 245 | 12 | 23 | 35 | 8 |
| J | 245 | 12 | 23 | 35 | 11.3 |
| J | 245 | 12 | 23 | 35 | 15.5 |
| J | 245 | 12 | 23 | 35 | 9.1 |
| J | 245 | 12 | 23 | 35 | 13.6 |
After generating the above output table, my final result will be the one with lowest weighted total (8)
I have attached the workflow herewith.
Any suggestion on how to do this in a looped manner?