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

Sum of Sum columns in Grid

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Udaya
Top achievements
Rank 1
Udaya asked on 12 Mar 2015, 06:18 AM
I have kendo grid as follows
    <script>
            $(document).ready(function () {
                $.support.cors = true;

                var url = "url";

                $("#grid").kendoGrid({
                    dataSource: {
                        type: "json",
                        transport: {
                            read: url
                        },
                        schema: {
                            model: {
                                fields: {
                                    ResourceName: { type: "string" },
                                    ProjectName: { type: "string" },
                                    WeekOneUtilization: { type: "number" },
                                    WeekTwoUtilization: { type: "number" },
                                    WeekThreeUtilization: { type: "number" },
                                    WeekFourUtilization: { type: "number" },
                                }
                            }
                        },
                        group: {
                            field: "ResourceName",
                            aggregates: [
                               { field: "WeekOneUtilization", aggregate: "sum" },
                                { field: "WeekTwoUtilization", aggregate: "sum" },
                                 { field: "WeekThreeUtilization", aggregate: "sum" },
                                  { field: "WeekFourUtilization", aggregate: "sum" }
                            ]
                        },
                        aggregate: [{ field: "ProjectName", aggregate: "count" },
                                    { field: "WeekOneUtilization", aggregate: "sum" },
                                { field: "WeekTwoUtilization", aggregate: "sum" },
                                 { field: "WeekThreeUtilization", aggregate: "sum" },
                                  { field: "WeekFourUtilization", aggregate: "sum" }]
                    },
                    height: '100%',
                    width: 500,
                    columns:
                        [
                            {
                                field: "ResourceName",
                                title: "Resource Name",
                                width: 225
                            },
                        {
                            field: "ProjectName",
                            title: "Project Name",
                            width: 100
                        },
                            {
                                field: "WeekOneUtilization",
                                title: "@weekOneDisplayName",
                                width: 100,
                                aggregates: ["sum"],
                                //footerTemplate: "Total Utilization: #=sum#",
                                groupFooterTemplate: "Individual Utilization: #=sum#"
                            },
                              {
                                  field: "WeekTwoUtilization",
                                  title: "@weekTwoDisplayName",
                                  width: 100,
                                  aggregates: ["sum"],
                                  //footerTemplate: "Total Utilization: #=sum#",
                                  groupFooterTemplate: "Individual Utilization: #=sum#"
                              },
                                {
                                    field: "WeekThreeUtilization",
                                    title: "@weekThreeDisplayName",
                                    width: 100,
                                    aggregates: ["sum"],
                                    //footerTemplate: "Total Utilization: #=sum#",
                                    groupFooterTemplate: "Individual Utilization: #=sum#"
                                },
                                  {
                                      field: "WeekFourUtilization",
                                      title: "@weekFourDisplayName",
                                      width: 100,
                                      aggregates: ["sum"],
                                      //footerTemplate: "Total Utilization: #=sum#",
                                      groupFooterTemplate: "Individual Utilization: #=sum#"
                                  },
                        ]
                });

            });
        </script>

I want to add new column to the group footer with the sum of all four week sum. How can I achieve that in kendo grid

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 17 Mar 2015, 08:11 AM

Hello Udaya,

I am afraid that currently aggregate of aggregates is not supported, and there can be just one level of aggregating. You can submit this as a feature request on UserVoice, so that it is considered for implementation in a future release.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Udaya
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or