Trying to use Row Aggregator to generate weighted averages and am getting some weird results. As a test, I started with a simple table with five rows where the first column (Weight) is a counter with values 1 to 5 and the second (Value) has a value of 3 for every row. I would expect the weighted average would be 3, but the result I’m getting is 9
Here is the configuration of the node:
It appears that the node is taking the sum of the products of each Weight, Value pair (45) and dividing by the number of rows (5). A proper weighted average would be to divide that sum by the total of the weights (15) which would result in a value of 3. I’ve tried this with a number of data sets and every test bears this out.
Is there something wrong with my configuration?