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

2 posts, 0 answers
  1. Pankaj
    Pankaj avatar
    1 posts
    Member since:
    Jan 2014

    Posted 15 Jan 2015 Link to this post


    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


  2. Vasil
    Vasil avatar
    1547 posts

    Posted 19 Jan 2015 Link to this post

    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.


    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.

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