Question

2
Replies
43
Views
Close popover
Jeff Gosnell (JeffGo)
Appriss, Inc

Appriss, Inc
US
JeffGo Member since 2017 14 posts
Appriss, Inc
Posted: February 18, 2020
Last activity: February 18, 2020
Closed

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]

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.

Pega Platform 7.3.1 Enterprise Application Development Dev/Designer Studio Pega Academy
Moderation Team has archived post,
Close popover This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.