calculated fields in pivot grid

2 Answers 22 Views
PivotGrid and PivotFieldList
Rolf
Top achievements
Rank 1
Rolf asked on 18 Aug 2022, 10:31 AM

Hello,

I haven't seen this in the demos or documentation (yet?). is it possible to build a third calculated field out of two calculated fields?

Example: CalculatedField1 = Field1 + Field2

CalculatedField2 = Field3 + Field4

CalculatedField3 = calculatedField1 / calculatedField2

thanks in advance

Rolf Kaleveld

2 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 19 Aug 2022, 10:15 AM

Hello Rolf,

Thank you for your interest in our RadPivtoGrid control for WinForms.

So far we haven't got such a request. Generally speaking, the third calculated field could be a formula of the previous two fields combined. For example:

CalculatedField1 = Field1 + Field2

CalculatedField2 = Field3 + Field4

CalculatedField3 = (Field1 + Field2 ) / (Field3 + Field4)

Could this be an option for you?

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Rolf
Top achievements
Rank 1
commented on 19 Aug 2022, 10:46 AM

Hello Dinko,

 

thank you for your answer. Of course CalculatedField3 could be defined the way you suggested. But CalculatedField1  a) could be more complex and b) the definition might be changed later. then the definition of CalculatedField3 has to be corrected, too. on top of it CalculatedField1 could be used in several other calculated fields.
where is the calculated field stored? if the definition results in an additional field in the underlying dataset for the pivot grid shouldn't the calculated fields be available for new calculated fields? 

Regards

Rolf

0
Dinko | Tech Support Engineer
Telerik team
answered on 24 Aug 2022, 08:12 AM

Hello Rolf,

Thank you for the additional details. You have a point here. I have searched for a way to achieve this and it could be done. In a custom-calculated field, you can get another calculated field value. The RequiredField class exposes ForCalculatedField() method which you can use in this case. To demonstrate this I have prepared a sample project. In a few words, the Commission calculated field is represented by 10% of the MyQuantity calculated field. When you run the project, check the MyQuantity and then the Commission field. I think this is what you are looking for.

Regards,
Dinko
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
PivotGrid and PivotFieldList
Asked by
Rolf
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or