Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Average aggregator
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kavitha Raghavachar  
View profile  
 More options Mar 28 2012, 10:18 pm
From: Kavitha Raghavachar <kavitha.raghavac...@cbsinteractive.com>
Date: Wed, 28 Mar 2012 19:18:40 -0700 (PDT)
Local: Wed, Mar 28 2012 10:18 pm
Subject: Average aggregator

Hi,
I have 200 rows feed and on a particular Field, I want to take an Average.
I tried

leadsPipe = new Every(leadsPipe, LEADSS1, new Average(LEADSS1_AVG));

where LEADSS1 is a field I want to take average on and LEADSS1_AVG is a new
field where my average computed value will be held.

The above code gives me the Sum of that field. (I verified it by copying
the feed to Excel and taking an average on a column)

Please help.
Thanks,
Kavitha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Linsay  
View profile  
 More options Mar 28 2012, 10:34 pm
From: Ben Linsay <blin...@gmail.com>
Date: Wed, 28 Mar 2012 19:34:57 -0700 (PDT)
Local: Wed, Mar 28 2012 10:34 pm
Subject: Re: Average aggregator

It sounds like your GroupBy (or CoGroup) isn't working the way you think it
is.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris K Wensel  
View profile  
 More options Mar 29 2012, 1:04 am
From: Chris K Wensel <ch...@wensel.net>
Date: Wed, 28 Mar 2012 22:04:36 -0700
Local: Thurs, Mar 29 2012 1:04 am
Subject: Re: Average aggregator

can we see more code leading up to the Average?

ckw

On Mar 28, 2012, at 7:18 PM, Kavitha Raghavachar wrote:

--
Chris K Wensel
ch...@concurrentinc.com
http://concurrentinc.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kavitha Raghavachar  
View profile  
 More options Mar 29 2012, 2:11 am
From: Kavitha Raghavachar <kavitha.raghavac...@cbsinteractive.com>
Date: Wed, 28 Mar 2012 23:11:11 -0700 (PDT)
Local: Thurs, Mar 29 2012 2:11 am
Subject: Re: Average aggregator

Hi Chris,
leadsPipe = new GroupBy(leadsPipe,
LEADSS1.append(LEADSS7).append(LEADSS30).append(PAGESS1).append(PAGESS7).ap pend(PAGESS30));
        leadsPipe = new Every(leadsPipe, LEADSS1, new Average(LEADSS1_AVG));

Now the problem is this.

The actual average of all the rows for Field LEADSS1 is   0.061538462
(According to calculation in Excel)

I am getting 0.0 which is rounded to 1 decimal.
How can I format it to show me at least 5 decimals?

Thanks,
Kavitha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris K Wensel  
View profile  
 More options Mar 29 2012, 2:29 am
From: Chris K Wensel <ch...@wensel.net>
Date: Wed, 28 Mar 2012 23:29:28 -0700
Local: Thurs, Mar 29 2012 2:29 am
Subject: Re: Average aggregator

Aggregators (like Average) perform over the set of values associated with a unique set of grouping keys, just like the way SQL works.

unfortunately you are including the thing your are averaging in the grouping keys which means all the values of LEADSS1 Average is seeing are probably the same for each unique group.

removing LEADSS1 from the grouping will likely give you a better result.

ckw

On Mar 28, 2012, at 11:11 PM, Kavitha Raghavachar wrote:

--
Chris K Wensel
ch...@concurrentinc.com
http://concurrentinc.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kavitha Raghavachar  
View profile  
 More options Mar 29 2012, 2:39 am
From: Kavitha Raghavachar <kavitha.raghavac...@cbsinteractive.com>
Date: Wed, 28 Mar 2012 23:39:32 -0700 (PDT)
Local: Thurs, Mar 29 2012 2:39 am
Subject: Re: Average aggregator

Thanks Chris.
how about the rounding decimal to show 6 decimals?
Since the actual average is 0.06XXXXX, my result is showing just 0.0 and I
want to be able to display up to 6 decimals.

Thanks,
Kavitha


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris K Wensel  
View profile  
 More options Mar 29 2012, 12:04 pm
From: Chris K Wensel <ch...@wensel.net>
Date: Thu, 29 Mar 2012 09:04:08 -0700
Local: Thurs, Mar 29 2012 12:04 pm
Subject: Re: Average aggregator

see
http://www.cascading.org/1.2/javadoc/cascading/operation/text/FieldFo...

ckw

On Mar 28, 2012, at 11:39 PM, Kavitha Raghavachar wrote:

--
Chris K Wensel
ch...@concurrentinc.com
http://concurrentinc.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »