Calculation expressions : available formulas

2 posts, 0 answers
  1. Maxime
    Maxime avatar
    2 posts
    Member since:
    Mar 2015

    Posted 16 Mar 2017 Link to this post

    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

  2. Eyup
    Admin
    Eyup avatar
    3626 posts

    Posted 21 Mar 2017 Link to this post

    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.
Back to Top