Filter Contact History Attributes: DATE Attributes | Vantage CX - 1.4 - Filter on Contact History Attributes: DATE Attributes - Vantage Customer Experience

Vantage Customer Experience User Guide

prodname
Vantage Customer Experience
vrm_release
1.4
created_date
June 2021
category
User Guide
featnum
B035-3800-099K
All existing DATE expression functions, time periods, formats, and so on, can be used.

Fixed Dates

Example 1

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Signed up Date' starting at March 1, 2020
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                  "ContactHistory.sms.dcat.signupdate", formatDateTime("day"), greaterThanOrEqual(time("2020-03-01","day")))) &&
count(signupdates) > 0
The above example presents a combination of new and existing expression functions to evaluate DATE-related criteria for a DATE Attribute saved in Contact History:
  • set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge"))

    See Using Multiple Keyname Filters.

  • set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1)))

    See Filter Contact History on Frequency and Recency Values.

  • set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                       "ContactHistory.sms.dcat.signupdate", formatDateTime("day"), greaterThanOrEqual(time("2020-03-01","day"))))
    This is divided into two sub-expressions:
    • contactHistory(extendedOnChannel, "attribute", "ContactHistory.sms.dcat.signupdate", formatDateTime("day"), greaterThanOrEqual(time("2020-03-01","day"))))

      In this expression, the filtered Contact History data from the preceding expression is represented by the first input, the extendedOnChannel variable. The second and third inputs are standard formats to refer to a specific Contact History Attribute, in this case, a DATE Attribute called signupdate. Every value of the signupdate Attribute is formatted into a Day time period, as indicated by the expression formatDateTime("day"). This time period is then evaluated against the Day time period equivalent of the DATE criteria March 1, 2020 (using the existing DATE expression function time).

    • set("signupdates"...

      The resulting List from the contactHistory expression function is placed in the signupdates variable.

  • count(signupdates) > 0

    This is standard count evaluation of a resulting List from the preceding expression.

Example 2

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Signed up Date' is between February and May
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                  "ContactHistory.sms.dcat.signupdate", formatDateTime("month"), 
                   between(time("2020-02-01","month"), time("2020-05-01","month")))) &&
count(signupdates) > 0

In the above example, the Month time periods of the Dates February 1, 2020 and May 1, 2020 are compared against the same time period equivalent of the Contact History DATE Attribute signupdate. When the whole expression becomes unmanageable due to several nested sub-expressions, use variables to temporarily hold their values using the set expression function. Then the variables can be used in place of the nested expressions. The above example can be re-written in a longer but much more clear expressions:

Example 2a

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Signed up Date' is between February and May
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
 
 
set("signupDateAttributeName", "ContactHistory.sms.dcat.signupdate") &&
set("februaryMonthTimePeriod", time("2020-02-01","month")) &&
set("mayMonthTimePeriod", time("2020-05-01","month")) &&
set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                   signupDateAttributeName, formatDateTime("month"), 
                   between(februaryMonthTimePeriod, mayMonthTimePeriod))) &&
count(signupdates) > 0

Example 3

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Signed up Date' falls on 15th day of the month
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                  "ContactHistory.sms.dcat.signupdate", formatTimePeriod("day"), equalTo(15))) && 
count(signupdates) > 0

Example 4

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Signed up Date' is on February
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                  "ContactHistory.sms.dcat.signupdate", formatTimePeriod("month"), equalTo(2))) && 
count(signupdates) > 0

Relative Dates

Example 5

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Signed up Date' is 10 days starting from 5 days ago
 
 
starting at March 1, 2020
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
 
 
set("startDate",time(now,5,"day","past")) &&
set("endDate",time(startDate,10,"day","future")) &&
  
set("signupdates", contactHistory(extendedOnChannel, "attribute", 
                  "ContactHistory.sms.dcat.signupdate", formatDateTime("day"), between(startDate, endDate))) &&
count(signupdates) > 0

Example 6

Criteria:
-Qualify if: 
-Message 'M1' has been extended at least once
-In 'SMS' Channel
-For Message Strategy 'Recharge'
-In the last hour
-AND 'Expiration Date' falls between 3 weeks from now and 2 months after that
 
 
Expression:
set("extendedCH", contactHistory("response", "extended", "message", "msg1", "messageStrategy", "recharge")) &&
set("extendedOnChannel", contactHistory(extendedCH, "frequency", greaterThanOrEqual(1), "recency", "hour", lessThanOrEqual(1))) &&
 
 
set("startDate",time(now,3,"week","future")) &&
set("endDate",time(startDate,2,"month","future")) &&
  
set("expirationdates", contactHistory(extendedOnChannel, "attribute", 
                  "ContactHistory.sms.dcat.expirationdate", formatDateTime("day"), between(startDate, endDate))) &&
count(expirationdates) > 0