How would I achieve this?
5 Answers, 1 is accepted
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.
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?
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.
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!
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.