Filter Contact History by Keyname: Pattern and Regular Expressions | Vantage CX - Filter Contact History by Keyname: Pattern and Regular Expressions - Vantage Customer Experience

Vantage Customer Experience User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Vantage Customer Experience
Release Number
1.6
Published
October 2023
Language
English (United States)
Last Update
2023-10-26
dita:mapPath
hbt1563223944614.ditamap
dita:ditavalPath
oyf1565965838286.ditaval
dita:id
tmo1562969305444
Product Category
Teradata Applications

Patterns and regular expressions can also be used to filter Contact History data by Keyname. Use the pattern expression function in conjunction with the contactHistory function.

For example, let say 'foo' is the text to search:

Keyname is case-sensitive when used in expressions.

pattern

pattern("foo.*")          // starts with
pattern("^(?!foo).*")     // not starts with
pattern(".*foo")          // ends with
pattern("^(?!.*foo$).*")  // not ends with
pattern(".*foo.*")        // contains
pattern("^((?!foo).)*")   // not contains

Example 1

Criteria:
-Qualify if: 
-A Message has been extended or responded in Channel with Keyname that starts with 'sms'
 
Expression:
set("extendedOrResponded", contactHistory("channel", pattern("sms.*"))) &&
count(extendedOrResponded) > 0

Example 2

Criteria:
-Qualify if: 
-A Message has been extended or responded to the customer
-In any Channel
-For Message Strategy with Keyname that contains the text 'recharge'
 
Expression:
set("extendedOrResponded", contactHistory("messageStrategy", pattern(".*recharge.*"))) &&
count(extendedOrResponded) > 0
In this case, Message Strategy 'Recharge' Keyname, which is 'recharge', is used to filter Contact History data. This is similar to running the following SQL query:
select * from contact_history_table where message_strategy_keyname = 'recharge'

No other conditions are needed in the expressions. The resulting List is evaluated by the count function.