This is a migrated thread and some comments may be shown as answers.

CalculatedField with count function

1 Answer 13 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Sigsa
Top achievements
Rank 1
Sigsa asked on 19 Aug 2014, 11:24 PM
Hello Everyone,

I have a problem when I try to extend a custom class from CalculatedField. I need to add a custom formula: the count of fieldA / sum of fieldB, but both always return the sum function, not the count for the first field.

protected override Telerik.Pivot.Core.Aggregates.AggregateValue CalculateValue(IAggregateValues aggregateValues)
{       
   var aggregateA = aggregateValues.GetAggregateValue(this.fieldA); //I need the count function here
   var aggregateB = aggregateValues.GetAggregateValue(this.fieldB); //and the sum function here


I will appreciate any sort of help greatly! 

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 20 Aug 2014, 03:22 PM
Hi Sigsa,

I noticed you have posted the same questions in this thread. I have already answered you, so you can check my there.

Regards,
Kalin
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
PivotGrid
Asked by
Sigsa
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or