Sum of data show in list of dictionary

Certified Associate Developer

Hiii,

I want to add the Total Cost . It show the data in below format. I am using sum function to add the data but it is not working.

List of Dictionary - 7 items

    • Dictionary
        • Total_Cost19000(Number (Integer))
          • Dictionary
              • Total_Cost18000(Number (Integer))
                • Dictionary
                    • Total_Cost15000(Number (Integer))
                      • Dictionary
                          • Total_Cost7000(Number (Integer))
                            • Dictionary
                                • Total_Cost9000(Number (Integer))
                                  • Dictionary
                                      • Total_Cost13000(Number (Integer))
                                        • Dictionary
                                            • Total_Cost1500(Number (Integer))

                                            Discussion posts and replies are publicly visible

                                          Parents
                                          • 0
                                            Certified Lead Developer
                                            but it is not working.

                                            What exactly does this mean? And, can you share your code?

                                          • 0
                                            Certified Associate Developer
                                            in reply to Stefan Helzle

                                            a!localVariables(
                                              local!emailData: a!queryEntity(
                                                entity: cons!ERV_dataEntity,
                                                query: a!query(
                                                  selection: a!querySelection(
                                                    columns: a!queryColumn(field: "totalCost", alias: "Total_Cost")
                                                  ),
                                                  logicalExpression: a!queryLogicalExpression(
                                                    operator: "AND",
                                                    filters: {
                                                      a!queryFilter(field: "totalCost", operator: "not null"),
                                                      a!queryFilter(
                                                        field: "rmApproval",
                                                        operator: "=",
                                                        value: true
                                                      )
                                                    }
                                                  ),
                                                  pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 20)
                                                )
                                              ).data,
                                              local!emailData
                                            )

                                            a!localVariables(
                                              local!emailData: a!queryEntity(
                                                entity: cons!ERV_dataEntity,
                                                query: a!query(
                                                  selection: a!querySelection(
                                                    columns: a!queryColumn(field: "totalCost", alias: "Total_Cost")
                                                  ),
                                                  logicalExpression: a!queryLogicalExpression(
                                                    operator: "AND",
                                                    filters: {
                                                      a!queryFilter(field: "totalCost", operator: "not null"),
                                                      a!queryFilter(
                                                        field: "rmApproval",
                                                        operator: "=",
                                                        value: true
                                                      )
                                                    }
                                                  ),
                                                  pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 20)
                                                )
                                              ).data,
                                              local!emailData
                                            )

                                          Reply
                                          • 0
                                            Certified Associate Developer
                                            in reply to Stefan Helzle

                                            a!localVariables(
                                              local!emailData: a!queryEntity(
                                                entity: cons!ERV_dataEntity,
                                                query: a!query(
                                                  selection: a!querySelection(
                                                    columns: a!queryColumn(field: "totalCost", alias: "Total_Cost")
                                                  ),
                                                  logicalExpression: a!queryLogicalExpression(
                                                    operator: "AND",
                                                    filters: {
                                                      a!queryFilter(field: "totalCost", operator: "not null"),
                                                      a!queryFilter(
                                                        field: "rmApproval",
                                                        operator: "=",
                                                        value: true
                                                      )
                                                    }
                                                  ),
                                                  pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 20)
                                                )
                                              ).data,
                                              local!emailData
                                            )

                                            a!localVariables(
                                              local!emailData: a!queryEntity(
                                                entity: cons!ERV_dataEntity,
                                                query: a!query(
                                                  selection: a!querySelection(
                                                    columns: a!queryColumn(field: "totalCost", alias: "Total_Cost")
                                                  ),
                                                  logicalExpression: a!queryLogicalExpression(
                                                    operator: "AND",
                                                    filters: {
                                                      a!queryFilter(field: "totalCost", operator: "not null"),
                                                      a!queryFilter(
                                                        field: "rmApproval",
                                                        operator: "=",
                                                        value: true
                                                      )
                                                    }
                                                  ),
                                                  pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 20)
                                                )
                                              ).data,
                                              local!emailData
                                            )

                                          Children
                                          No Data