Expressions are most effective when you need a value that cannot be ingested directly; one that must be derived from existing data at runtime. The examples below cover the two most common patterns: date arithmetic and string concatenation.
Date difference: days since loyalty activation
Pattern: You want to create a calculated attribute that shows how many days have passed since a user’s Loyalty Activation Date.
This expression calculates how many days have passed since a user enrolled in a loyalty program. The result is stored as a numeric calculated attribute on the user profile and updates continuously as time passes.
Here’s how it works:
The system compares the current date (today) with the user’s Loyalty Activation Date, which is an existing custom attribute.
If both dates are valid, it calculates the difference in days and stores it as a new calculated attribute.
Example:
Today’s date: June 1, 2025
Loyalty Activation Date: May 1, 2025
Calculated difference: 31 days
The value 31 is written to the user profile under the name you assigned when creating the expression. From that point, it behaves as any other attribute, available for segmentation, dynamic content, or reporting.

String concatenation: combining city and country
Pattern: Join two or more string attribute values into a single combined attribute on an event or store profile.
This expression creates a location label for each store profile by combining the store's city attribute with its country attribute. The result is a single calculated attribute that can be used for display, segmentation, or reporting without requiring a manual data update each time either source value changes.
If you want to create a new attribute that shows where each store is located, including the country, create an expression like this:

Each store profile receives a store_location calculated attribute whose value is resolved individually from that store's own store_city and store_country attributes. Updating either source attribute automatically updates the calculated result.
This expression is configured on an event or store profile, not a user profile. Verify the correct profile scope is selected in the expression builder before saving.