Showing posts with label aggregate. Show all posts
Showing posts with label aggregate. Show all posts

Saturday, February 23, 2008

Exploring the Aggregate - count function

count




This returns the number of nodes/rows within the scope of the 'in-context'

Basically counts how many repeating elements have gone by it.

To illustrate it, lets create a text file count.txt and add it with simple csv processing, then add a count function then connect the Field1 to the nodes/rows. Then create an out text with simple csv processing and connect the result to the Field1 of the out text.

count.txt contains (9 1's on separate lines)

1
1
1
1
1
1
1
1
1

Which will look something like this.




As you might imagine, if you hit the output tab you will get 9 (the number of repeating rows that came through the 'counter' box)



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.