Creating new aggregates on streamable data
In Pega Customer Decision Hub™, Pega Customer Profile Designer lets you define aggregated summaries on streamable data. You can add, edit, or remove aggregates directly on the summary rule using various functions and conditions.
Video
Challenge
Tip: To practice what you have learned in this topic, consider taking the Creating new aggregates on streamable data challenge.
Transcript
This demo shows you how to add new aggregates to a summary and test the calculations.
The U+ Bank technical team has completed setting up the Customer Profile Designer Accelerator and integrated the U+ Bank website with Customer Decision Hub. The marketers want to extend the financial clickstream summary with a new attribute that calculates the average time customers spend on the account overview page in the last 7 days.
The technical team has notified you that every time a customer navigates the U+ Bank website, an event is sent to the clickstream service and shares the following data structure with you.
Property |
Description |
Type |
List of Values |
Event |
Type of event that occurred |
Text |
PageView Login Logout |
Page Type |
The type of page that the visitor visited |
Text |
Home Account Card Deposit Loan Investment |
Page View Active Time |
The time in seconds the visitor spent on the page |
Integer |
To create a new aggregation, navigate to the Summaries tab on the Profile Data Sources landing page and launch the Financial services clickstream summary rule.
The Summary rule lists the attributes that define how the clickstream data is aggregated. Each aggregate must have a unique Name, an aggregate Function, and a time window. The type of aggregation function automatically determines the property type (text, integer, or decimal). Create a new aggregate that calculates the average time spent on the account overview page. Give the aggregate a unique name, Avg Active Secs Account Last 7 Days. The ID for the aggregate is set automatically. It is important to keep the name as short as possible.
You can use seven functions for the aggregations. Common mathematical functions such as Sum, Count, Average, Min, and Max are available for calculations. You can also use the First and Last functions for storing the first or last value of a given attribute. For example, the name of the website page customer last visited.
In the Function list, select Average. The selection forces you to choose the field that you want to use to calculate the average of. Note that you can select only numeric fields from the list of values because this function is a mathematical function. Select PageViewActiveTime. Now, enter the time window for the aggregation. You can let the aggregation occur without a time frame (since the start of the aggregation), or you can define a sliding window in minutes, days, or weeks.
Now that you have entered the name, function, and time window for the aggregate, it is time to create a condition that filters only the relevant events that you want calculated. In this case, you want the calculate the average only when the Event is PageView and PageType is Account. Any other case where the condition is not satisfied is not considered during calculation.
After you successfully add an aggregate and save the summary rule, the property is created and marked as relevant for availability in engagement policies.
Because the summary is already associated with the customer, test whether the values are getting calculated and stored.
Launch the U+ Bank website and log in as Troy. Logging in creates a single web activity for Troy by accessing his Account overview page.
Navigate back to Dev Studio, and then browse the Clickstream data set to confirm that the event data is sent Customer Decision Hub.
Browse the data set to confirm that there is a single event. Take a closer look at the Event, PageType, and PageViewActiveTime attributes. When Troy logs in to the U+ Bank website, an event occurred where the Event is PageView, and the PageType is Account, and the PageViewActiveTime is 41 seconds.
The Financial services clickstream summary uses the Clickstream data set as its source. Every time an event is produced and the aggregate condition is satisfied, the corresponding attribute is re-calculated.
Now, browse the FSClickstream data set to view the AvgActiveSecsAccountLast7Days attribute. Because Troy viewed the Account overview page only once, the calculation is equal to the PageViewActiveTime.
Go back to the U+ Bank website, log out, and then log back in to create an additional event for the Account overview page.
Return to Dev Studio, and then browse the Clickstream data set. Notice that there are three events on the stream. The first event indicates the first login from Troy. Logging out and navigating to the home page generated another event. Then, logging back in as Troy sent a third event. Note that the average time spent on the page is 7 seconds.
Browse the FSClickstream data set to confirm that the average is calculated.
This demo has concluded. What did it show you?
- How to create a new summary aggregate
- What event data is generated in the Clickstream data set, and how this data is aggregated in the FSClickstream dataset
This Topic is available in the following Modules:
If you are having problems with your training, please review the Pega Academy Support FAQs.
Want to help us improve this content?