> 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 received this message because you are subscribed to the Google Groups "cascading-user" group. > To view this discussion on the web visit https://groups.google.com/d/msg/cascading-user/-/Jd6YNL3VKX0J. > To post to this group, send email to cascading-user@googlegroups.com. > To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
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?
On Wednesday, March 28, 2012 10:04:36 PM UTC-7, Chris K Wensel wrote:
> can we see more code leading up to the Average?
> ckw
> On Mar 28, 2012, at 7:18 PM, Kavitha Raghavachar wrote:
> 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 received this message because you are subscribed to the Google Groups > "cascading-user" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/cascading-user/-/Jd6YNL3VKX0J. > To post to this group, send email to cascading-user@googlegroups.com. > To unsubscribe from this group, send email to > cascading-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/cascading-user?hl=en.
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:
> 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
> On Wednesday, March 28, 2012 10:04:36 PM UTC-7, Chris K Wensel wrote: > can we see more code leading up to the Average?
> ckw
> On Mar 28, 2012, at 7:18 PM, Kavitha Raghavachar wrote:
>> 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 received this message because you are subscribed to the Google Groups "cascading-user" group. >> To view this discussion on the web visit https://groups.google.com/d/msg/cascading-user/-/Jd6YNL3VKX0J. >> To post to this group, send email to cascading-user@googlegroups.com. >> To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
> -- > You received this message because you are subscribed to the Google Groups "cascading-user" group. > To view this discussion on the web visit https://groups.google.com/d/msg/cascading-user/-/9IMLiZp_RrAJ. > To post to this group, send email to cascading-user@googlegroups.com. > To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
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.
On Wednesday, March 28, 2012 11:29:28 PM UTC-7, Chris K Wensel wrote:
> 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:
> 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
> On Wednesday, March 28, 2012 10:04:36 PM UTC-7, Chris K Wensel wrote:
>> can we see more code leading up to the Average?
>> ckw
>> On Mar 28, 2012, at 7:18 PM, Kavitha Raghavachar wrote:
>> 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 received this message because you are subscribed to the Google Groups >> "cascading-user" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/cascading-user/-/Jd6YNL3VKX0J. >> To post to this group, send email to cascading-user@googlegroups.com. >> To unsubscribe from this group, send email to >> cascading-user+unsubscribe@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/cascading-user?hl=en.
> -- > You received this message because you are subscribed to the Google Groups > "cascading-user" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/cascading-user/-/9IMLiZp_RrAJ. > To post to this group, send email to cascading-user@googlegroups.com. > To unsubscribe from this group, send email to > cascading-user+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/cascading-user?hl=en.
> 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
> On Wednesday, March 28, 2012 11:29:28 PM UTC-7, Chris K Wensel wrote:
> 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:
>> 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
>> On Wednesday, March 28, 2012 10:04:36 PM UTC-7, Chris K Wensel wrote: >> can we see more code leading up to the Average?
>> ckw
>> On Mar 28, 2012, at 7:18 PM, Kavitha Raghavachar wrote:
>>> 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 received this message because you are subscribed to the Google Groups "cascading-user" group. >>> To view this discussion on the web visit https://groups.google.com/d/msg/cascading-user/-/Jd6YNL3VKX0J. >>> To post to this group, send email to cascading-user@googlegroups.com. >>> To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com. >>> For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
>> -- >> You received this message because you are subscribed to the Google Groups "cascading-user" group. >> To view this discussion on the web visit https://groups.google.com/d/msg/cascading-user/-/9IMLiZp_RrAJ. >> To post to this group, send email to cascading-user@googlegroups.com. >> To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com. >> For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.
> -- > You received this message because you are subscribed to the Google Groups "cascading-user" group. > To view this discussion on the web visit https://groups.google.com/d/msg/cascading-user/-/DaDOMDeHrAkJ. > To post to this group, send email to cascading-user@googlegroups.com. > To unsubscribe from this group, send email to cascading-user+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/cascading-user?hl=en.