I am looking to perform a set of processes, then go back to initial data and perform that set of processes again for another input. I am assuming an iterative macro is needed. See the attached data set in excel with an example of what I am trying to do (scaled down).
My current process is to input a macro, formula tool the abs value difference between my input number i am iterating through (1 to 10) from the "number field". I then sort this from smallest to largest and take the top 8 records with a sample tool. I then use summarize to average those values which shows the avg "Value", the "Number", and the "iteration number".
My output is currently getting to the right answer for the first input but doesnt show any more data in the macro run. When i bring into the larger data set (main file), the macro output is multiple rows but a different amount than the macro showed and is only averaging when the input matches the number but not averaging the closest N numbers like it does in the macro itself.
I am also attaching the actual macro which uses different fields/amounts compared to my excel example file in case that is easier.