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

Calculations on Grand Total columns

5 Answers 379 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 10 Mar 2014, 07:18 PM
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?

5 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 13 Mar 2014, 02:24 PM
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.

 
0
Julian
Top achievements
Rank 1
answered on 21 Apr 2015, 07:19 PM

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?

0
Konstantin Dikov
Telerik team
answered on 24 Apr 2015, 08:22 AM
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.

 
0
Julian
Top achievements
Rank 1
answered on 24 Apr 2015, 02:03 PM

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!

0
Konstantin Dikov
Telerik team
answered on 29 Apr 2015, 09:00 AM
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.

 
Tags
PivotGrid
Asked by
Rich
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Julian
Top achievements
Rank 1
Share this question
or