iteration over k values using variables in the K Nearest Neighbor node

Hi - I am trying to control the k value in the K Nearest neighbor from a variable so I can generate a table of various k values and the corresponding accuracy values.

This idea came from the sample 04Loops/01Loopoverasetofparameterforkmeans. In that sample, the values for k were generated by Table Creator and then fed into Table Row To Variable Loop Start, and the number of clusters in the k-Means node uses that variable.

I use the same approach in the K Nearest Neghbor node, but I get the error: Can’t merge FlowVariables Stacks (likely a loop problem).

Any idea how to parameterize the k values in the K Nearest Neighbor node?

Thank you.