Showing posts with label avg. Show all posts
Showing posts with label avg. Show all posts

Friday, February 22, 2008

Exploring the Aggregate - avg function

avg


result = avg(set)



Lets say you have a text file named avg.txt which contains
1
2
3
4
5

So add that selecting 'use simple processing for standard CSV'
Add an avg function
And connect your Field1 to the nodes/rows of the avg function
Then create an output text component with 'simple processing'





Now if you click the Output tab you should get 3

Now, I don't know why you don't connect the Rows to the in-context it sort of seems like you should, but if you do it will give you a 5 (the last item in your list of numbers) maybe someone out there can explain this to me?

Lets do
1.1234
2.3
4.6
5.678
7.0000008

Which gets us 4.14028016

Well I didn't figure out where the rounding point of this happens but I think its around the 26th decimal point. I'll leave that to someone else to pursue.