Dear community,
I need to create a macro which runs for any amount of input variables given, where the input values are grouped into quintiles of a given value.
For example, I have an simplistic input in the attachment and need to regroup the data into 5 classes so that each new class calculates to a quintile of the sum of all original values (in this example 400/5 = 80).
In Excel I solve the task by calculating the fraction between the quintile and the original value. If the fraction is below 1 I calculate the remaining rest and add it to the next input value and repeat the process again. If the fraction is above 1, the full input value is used and added to the next input value.
My problem is recreating this workflow in Alteryx. I think I need an iterative macro but am clueless how I can dynamically perform this task.
My initial thought was to calculate the fraction for the quintile and if it is below 1, calculate the remaining value and toss out the already used input value. But I can't create a functioning workflow nor have better idea to perform the task.
Any idea would be most appreciated.