Combine Criteria Expression Functions | Vantage CX - Combining Criteria Expression Functions - 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

Functions can be nested inside each other. You can also chain sets of functions together to create more complex criteria expressions. All standard rules for Java functions are supported such as the && (AND) operator and the || (OR) operator.

The following criteria expression sets a temporary variable called filteredCart with the list of cart complex attribute category's item attributes that have a value that matches ItemX. The criteria expression then creates a temporary variable called filteredWallet with a list of wallet discounted items that match ItemX.

Finally, the criteria expression returns true if the count of items in the filteredCart is greater than the number of items in the filteredWallet.

set("filteredCart",
  filter(
      get("Account.cart"),"item","ItemX"
  )
)&&
set("filteredWallet",
  filter(
      get("Account.wallet"),"discountedItem","ItemX"
  )
)&&
count(filteredCart) > count(filteredWallet)

The following criteria expression uses the pattern function extensively as well as the && operator. The criteria expression returns true if the customer has never seen a Savings page and has seen Product and Cards pages and Products within the last two pages and is currently on the Credit page.

index(
     get("Session.Customer.nav.page"),
     pattern(".*Savings")
) == -1 &&
index(
     get("Session.Customer.nav.page"),
     list(
        pattern("Products.*"),
        pattern(".*Cards.*"),
        pattern("Products.*", 2)
    )
) > -1 &&
get("Customer.nav.page") == "Credit"