Page 1 of 1

Pattern match control choices

Posted: Mon Dec 23, 2024 4:16 am
by phonedata
The choices are as follows:

Direction – First/Last. This controls whether we want to return the pattern as counted from the start of the transaction list, or from the end of it. A common requirement here would be to look for the Last time a pattern has occurred.

Number – 1 or more. This has to be a positive integer value, and will return this pattern number from the sorted list. If the person has had less than this number of matches then croatia phone number example a missing value will be returned.

Sort metric –This defines how we are going to sort the set of matched patterns. There are 3 options:

The default value is to sort the patterns in the order they are encountered in the sequence variable (typically in date order).
We can also order our pattern matches by the difference between the start and end sequence values. Typically when ordering by date variables this will be the number of days between the start and end of the pattern. With this option we can then answer questions of the form: ‘Find the shortest number of days in which a customer has bought product A then B’.
The final option is to sort by the number of transactions making up the sequence. This option is only relevant if the pattern contains the * wildcard (e.g. A*B) because in this case the patterns matched may be of different numbers of transactions. In this way we can find the shortest number of transactions taken to match A and then B in a sequence.