Getting cumulative total from Data Page in a table
I have seen how to create a Declare Expression to get the cumulative total from a collection property such as a Page List or a Data Page which returns a list. However, the problem I'm running into is that the examples I've found which include a data page don't have parameters.
My setup (Pega 7.3.1):
I have a table in a section that is backed by a datapage, we'll call D_GetCustomerSales[CustomerID: .CustomerID, StartDate: .StartDate, EndDate: .EndDate]
Obviously, since this is set in a table, the parameters are enumerated and I don't assign the params within the square braces as I've shown.
D_GetCustomerSales returns a list of MyProj-CustomerSales, which incudes a property called OrderTotalPrice.
Suppose the result of my table is as follows
Table [Data Page D_GetCustomerSales Results List of Class MyProj-CustomerSales]
I have seen how to create a Declare Expression to get the cumulative total from a collection property such as a Page List or a Data Page which returns a list. However, the problem I'm running into is that the examples I've found which include a data page don't have parameters.
My setup (Pega 7.3.1):
I have a table in a section that is backed by a datapage, we'll call D_GetCustomerSales[CustomerID: .CustomerID, StartDate: .StartDate, EndDate: .EndDate]
Obviously, since this is set in a table, the parameters are enumerated and I don't assign the params within the square braces as I've shown.
D_GetCustomerSales returns a list of MyProj-CustomerSales, which incudes a property called OrderTotalPrice.
Suppose the result of my table is as follows
Table [Data Page D_GetCustomerSales Results List of Class MyProj-CustomerSales]
Date | CustomerID | Items | OrderTotalPrice | |
---|---|---|---|---|
11/27/2019 | 14812 | 5 | $ 158.83 | |
12/14/2019 | 14812 | 2 | $ 29.44 | |
12/17/2019 | 14812 | 3 | $ 99.38 |
How would I setup my Declare Expression so that I can get the sum of OrderTotalPrice? I've got my property CumulativeOrderTotalPrice in the MyProj-CustomerSales class. And that is where the Declare Expression is located that I'm trying to create. But I think that if I do
Sum Of [ D_GetCustomerSales().OrderTotalPrice ] it would return all the values for OrderTotalPrice, not just the ones limited by the properties filtered in the table.