Expressions: Aggregations on the fly - Pattern Match with Grouping
Added in Q3 23
The aggregation processing mechanism optionally allows the passing through of a third piece of transactional information. For pattern matching, you can specify a grouping variable so that transactions are split into these groups before applying the pattern match to each of the groups individually. For example, you might want to look for transactional patterns for a particular department within the business, or perhaps look at items with a specific response code.
The screenshot below displays a person who has made four holiday bookings, ordered earliest to latest by booking date. Based on a destination visited pattern of the United States followed by Australia, the highlighted rows indicate that this person matches the required pattern once for the transactions on the 17th and 23rd December 2019.
It is possible to return the values on the grouping table - i.e. set for all booking records for this person, or alongside each transactional record that starts a pattern.
Creating and adding the following on the fly expression to the data grid, you can see that in this example the values are set on the second transactional record and matches records 2 and 3.
Let's now add a third piece of transactional information - here the Product variable - and use it to group the transactions by a selector value:
As a result, the same person now matches the pattern twice, firstly for records 1 and 3 - the Flight Only transactions on the 1st December and 2nd January; secondly for records 2 and 4 - the two Package Holiday transactions on the 17th and 23rd December.
All the same return options, and all of the existing pattern match wildcard elements, are valid in the grouped pattern match case.
See also:
-
Expressions: Aggregations On The Fly - Pattern Match Return Value On Transactional Table
-
Expressions: Aggregations On The Fly - Pattern Match Positional Wildcards
-
Expressions: Aggregations On The Fly - Pattern Match First Matched Pattern
-
Expressions: Aggregations On The Fly - Pattern Match Any Matched Pattern
-
Expressions: Aggregations on the fly - Pattern Match Include or Exclude List
Return to Expressions: Aggregations On The Fly