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

Need to add columns at runtime that will hold the difference between two groups aggregate columns

1 Answer 22 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Pankaj
Top achievements
Rank 1
Pankaj asked on 15 Jan 2015, 06:16 AM
Hi,

I am using Telerik PivotGrid control to create a dashboard for a US based client. Though i am experiencing few issues regarding columns.

We need to create report run time that means user can add/delete columns, aggregate columns, rows etc. In the basic scenario we  are showing year at the columns and two aggregate columns in the data.

So it showing like this

2013                                                2014                                         2015
---------------------------------------------------------------------------------------
 agg_col1  agg_col2                 agg_col1  agg_col2                      agg_col1  agg_col2 
---------------------------------------------------------------------------------------
value 1        value 3                     value 1        value 3                       value 1        value 3           
value 2         value 3                    value 1        value 3                       value 1        value 3        

This is working fine. Now client needs to add difference columns that will display difference between aggregate columns between year as show below.

2013                                                                                                                          2014                                         
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 agg_col1  agg_col2    diff_agg_col1   diff_agg_col2                                        agg_col1  agg_col2         diff_agg_col1                                                  diff_agg_col2            
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
value 1        value 3                                                                                                 value 1        value 3        agg_col1(2014) - agg_col1(2013)        col2(2014)-col2(2013) 
value 2        value 3                                                                                                value 1        value 3                     



It will go same as above shown, i have tried to use calculated column but we can give expression only for the same group name and other thing is how we can add at runtime.

Please help me out for this.

Thanks & Regards
Pankaj





  



1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 19 Jan 2015, 12:03 PM
Hello Pankaj,

This can be achieved by adding Calculated Item in the Year field. Please check this demo and especially how the "Forecast for 1999" item definition. In your case the function will simply calculate the difference.
http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/calculations/defaultcs.aspx

Regards,
Vasil
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PivotGrid
Asked by
Pankaj
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or