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

Calculation expressions : available formulas

1 Answer 50 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Maxime
Top achievements
Rank 1
Maxime asked on 16 Mar 2017, 10:08 AM

Hi,

 

I am currently doing advanced calculations in Pivot grid using calculation expressions.
I would like to use Square root function inside (sqrt). What are available function ? 

aggregateField.CalculationExpression = "(({0}/{1})*({1}-{2})";

 

i would like something like this to be evaluated : 

aggregateField.CalculationExpression = "(({0}/{1})*(Sqrt({1}-{2}))";

 

in my case i would like to avoid using OnItemNeedCalculation event, because all formulas are downloaded from a database dynamically, and it creates dynamically aggregates in pivot grid.

 

Regards,

Maxime LEMARE

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Mar 2017, 08:52 AM
Hello Maxime,

This syntax uses the following base to evaluate this expression:
https://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(v=vs.110).aspx

Which means that using Sqrt is not possible. You can try using the ItemNeedCalculation event handler as demonstrated in the following section:
http://docs.telerik.com/devtools/aspnet-ajax/controls/pivotgrid/fields/custom-data-calculations#calculated-items

And here is a live sample:
http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/calculations/defaultcs.aspx

I hope this will prove helpful.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
PivotGrid
Asked by
Maxime
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or