Calculations on Grand Total columns

6 posts, 0 answers
  1. Rich
    Rich avatar
    3 posts
    Member since:
    Nov 2012

    Posted 10 Mar 2014 Link to this post

    I'm looking to perform an additional calculation on the auto-calculated grand total columns.  The first column is a 'Total Revenue' column and the second is a 'Total Duration' column.  I'd like to divide 'Total Revenue' by 'Total Duration' and write this value to a new column.

    How would I achieve this?
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1798 posts

    Posted 13 Mar 2014 Link to this post

    Hello Rich,

    Thank you for contacting Telerik Support.

    With Q1 2014 release we have introduced a Custom Data Calculations functionality to RadPivotGrid. This functionality will allow you to easily accomplish the requirement that you have.

    An online demo with a demonstration of such calculations is available at the following link:
    As you will notice, the Average Price aggregate column is a result of a calculations between two other PivotGridAggregateField:
    <telerik:PivotGridAggregateField DataField="TotalPrice" Aggregate="Sum" DataFormatString="{0:C}">
    </telerik:PivotGridAggregateField>
    <telerik:PivotGridAggregateField DataField="Quantity" Aggregate="Sum">
    </telerik:PivotGridAggregateField>
    <telerik:PivotGridAggregateField DataField="Average Price" CalculationDataFields="TotalPrice,Quantity" CalculationExpression="{0}/{1}" DataFormatString="{0:C}" CellStyle-Font-Italic="true">
    </telerik:PivotGridAggregateField>

    Please give this a try and see if it meets your exact requirement and if any further assistance is needed, please do not hesitate to contact us again.


    Regards,
    Konstantin Dikov
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Julian
    Julian avatar
    54 posts
    Member since:
    Apr 2015

    Posted 21 Apr 2015 in reply to Konstantin Dikov Link to this post

    In regards to this solution this appears to add the calculation grand total across the whole pivot grid. So say you have your totalprice and qty showing for different stores. So the grid groups by stores. When you add the grandtotal calculation you get a new column added to each store.

     So it will look like:

    Store 1                                                 Store 2                                                   TTL Price GTotal  QTY GTotal  AVG Price GTTL

    Total Price     QTY     Avg Price          Total Price     QTY      Avg Price

     

    I don't want the avg price added to each store .. I only want to see the average price in the grand totals section to the right?

     

    Is this feasible?

  5. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1798 posts

    Posted 24 Apr 2015 Link to this post

    Hello Julian,

    This is the expected behavior and I have to say that it is not possible to hide the average aggregate columns for each store and display only the grand total. The RadPivotGrid will need to generate those "Avg Price" columns in order to calculate the GrandTotal.


    Best Regards,
    Konstantin Dikov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. Julian
    Julian avatar
    54 posts
    Member since:
    Apr 2015

    Posted 24 Apr 2015 in reply to Konstantin Dikov Link to this post

    Thanks for the reply,

     I actually tried to hide each store's "Avg Price" by applying a style to the column. In that style I set "display: none". As you probably already know this didn't work as I had hoped.  

    What would be nice going forward is the ability to only show the GrandTotal calculated colomn and hide the, in this case, Store's average price aggregate column.

     

    Thanks!

  7. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1798 posts

    Posted 29 Apr 2015 Link to this post

    Hi Julian,

    If you think this will be a good addition to the RadPivotGrid functionality, you can create a feature request item in our Ideas & Feedback Portal.

    When a feature request receives enough votes, our developers team will go through the request and determine whether or not such functionality could be introduced in the control.


    Regards,
    Konstantin Dikov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017