Derived fields
- Topics:
- Derived Fields
CREATED FOR:
- Admin
Derived fields are an important aspect of the real-time reporting functionality in Adobe Customer Journey Analytics. A derived field allows you to define (often complex) data manipulations on the fly, through a customizable rule builder. You can then use that derived field as a component (metric or dimension) in Workspace or even further define the derived field as a component in Data view.
Derived fields can save a significant amount of time and effort, compared to transforming or manipulating your data in other locations outside of Customer Journey Analytics. Such as Data Prep, Data Distiller, or within your own Extract Transform Load (ETL) / Extract Load Transform (ELT) processes.
Derived fields are defined within Data views, are based on a set of functions defined as rules, and applied to available standard and/or schema fields.
Example use cases are:
-
Define a derived Page Name field that corrects improper collected page name values to correct page name values.
-
Define a derived Marketing Channel field that determines the proper marketing channel based on one or more conditions (for example URL parameter, page URL, page name).
Derived field interface
When you create or edit a derived field, you use the derived field interface.
Name | Description | |
---|---|---|
1 | Selector | You use the selector area to select and drag and drop your function, function template, schema field, or standard field on to the rule builder. Use the drop-down to select between: You can search for function, function templates, schema, and standard fields using the You can filter the selected object list by selecting |
2 | Rule builder | You build your derived field sequentially using one or more rules. A rule is a specific implementation of a function and is therefore always associated with only one function. You create a rule by dragging and dropping a function into the rule builder. The function type determines the interface of the rule. See the Rule interface for more information. You can insert a function at the start, end, or in between rules already available in the rule builder. The last rule in the rule builder determines the final output of the derived field. |
3 | Field Settings | You can name and describe your derived field and inspect its field type. |
4 | Final Output | This area shows an on-the-fly updated preview of output values, based on data over the last 30 days and the changes you make to the derived field in the rule builder. |
Field template wizard
When you access the derived field interface for the first time, the Start with a field template wizard is shown.
- Select the template that best describes the type of field you are trying to create.
- Select the Select button to continue.
Your derived field dialog is populated with rules (and functions) required or useful for the type of field that you selected. See Function templates for more information on the available templates.
Rule interface
When you define a rule in the rule builder, you use the rule interface.
Name | Description | |
---|---|---|
A | Rule Name | By default the rule name is Rule X (X referring to a sequence number). To edit the name of a rule, select its name and type in the new name, for example Query Parameter . |
B | Function Name | The selected function name for the rule, for example URL PARSE. When the function is the last in the sequence of functions and determines the final output values, the function name is followed by - FINAL OUTPUT, for example URL PARSE - FINAL OUTPUT. To show a popup with more information on the function, select |
C | Rule Description | You can optionally add a description to a rule. Select Use the editor to enter a description. You can use the toolbar to format the text (using style selector, bold, italic, underline, right, left, centered, color, number list, bullet list) and adding links to external information. To finish editing the description, click outside of the editor. |
D | Function Area | Defines the logic of the function. The interface depends on the type of function. The dropdown for Field or Value shows all categories of fields (rules, standard fields, fields) available, based on the type of input the function expects. Alternatively, you can drag and drop a field from the Schema and Standard fields selector on to a Field or Value. When that dragged field is originating from a Lookup dataset, a Lookup function is automatically inserted before the function you define. See Function reference on detailed information for each of the functions supported. |
Create a derived field
-
Select an existing Data view or create a Data view. See Data views for more information.
-
Select the Components tab of the Data view.
-
Select Create derived field from the left rail.
-
To define your derived field, use the Create derived field interface. See Derived field interface.
To save your new derived field, select Save.
-
Your new derived field is added to the Derived fields > container, as part of Schema fields in the left rail of your Data view.
Edit a derived field
-
Select an existing Data view. See Data views for more information.
-
Select the Components tab of the Data view.
-
Select Schema fields tab in the Connection pane on the left.
-
Select Derived fields > container.
-
Hover over the derived field that you want to edit, and select
-
To edit your derived field, use the Edit derived field interface. See Derived field interface.
-
Select Save to save your updated derived field.
-
Select Cancel to cancel any changes you made to the derived field.
-
Select Save As to save the derived field as a new derived field. The new derived field has the same name as the original edited derived field with
(copy)
added to it.
-
Alternatively, if you have used a derived field as a component for dimensions or metrics in your data view:
-
Select the component. Note that the component might have a different name than your derived field.
-
In the Component panel, select the
-
To edit your derived field, use the Edit derived field interface. See Derived field interface.
-
Select Save to save your updated derived field.
-
Select Cancel to cancel any changes you made to the derived field.
-
Select Save As to save the derived field as a new derived field. The new derived field has the same name as the original edited derived field with
(copy)
added to it.
-
Delete a derived field
-
Select an existing Data view. See Data views for more information.
-
Select the Components tab of the Data view.
-
Select Schema fields tab in Connection pane.
-
Select Derived fields > container.
-
Hover over the derived field that you want to delete, and select
-
In the Edit derived field interface, select Delete.
A Delete component dialog asks you to confirm the deletion. Consider any external references there might exist to the derived field outside of the Data view.
- Select Continue to delete the derived field.
Alternatively, if you have used a derived field as a component for dimensions or metrics in your data view:
-
Select the component. Note that the component might have a different name than your derived field.
-
In the Component panel, select the
-
In the Edit derived field interface, select Delete.
A Delete component dialog asks you to confirm the deletion. Consider any external references there might exist to the derived field outside of the Data view.
- Select Continue to delete the derived field.
Function templates
To quickly create a derived field for specific use cases, function templates are available. These function templates can be accessed from the selector area in the derived field interface or are presented upon first use in the Start with a field template wizard.
Marketing channels
This function template uses a collection of rules to build marketing channels.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Bounces
This function template uses a collection of rules to identify site bounces.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Multi-Dimension Combine
This function template combines two values into one.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Friendly Dataset Name
This function template provides a readable dataset name.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Page Name from URL
This function template creates a simple page name.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Holiday Season
This function template classifies key times of the year.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Monthly Goals
This function template sets custom monthly goals.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Get All Values in Delimited List
This function template converts a limited list to an array.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Get First Value in Delimited List
This function template gets the first value in a delimited list.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Get Last Value in Delimited List
This function template gets the last value in a delimited list.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Domain Name
This function template extracts the domain name using a regular expression.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Get Query String Parameter
This function template extracts query string values.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Transition Field
This function template transitions reporting from one field to another field.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Simple Bot Detection
This function template implements light bot identification.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Exit Link
This function template identifies last link clicked in a session.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Download Link
This function template flags common download links.
To use the template, you have to specify the correct parameters for each function listed as part of the rules in the template. See Function reference for more information.
Function reference
For each supported function, find details below on:
-
specifications:
- input data type: type of data supported,
- input: possible values for input,
- included operators: operators supported for this function (if any),
- limitations: limitations that apply for this specific function,
- output.
-
use cases, including:
- data before defining the derived field,
- how to define the derived field,
- data after defining the derived field.
-
constraints (if applicable).
Case When
Applies conditionals, based on defined criteria from one or more fields. These criteria are then used to define the values in a new derived field, based on the sequence of the conditions.
Specifications
- String
- Numeric
- Date
-
If, Else If container:
- Value
-
- Rules
- Standard fields
- Fields Criterion (see included operators, based on selected value type)
-
Then set value to, Otherwise set value to:
- Value
- Rules
- Standard fields
- Fields
- Value
Strings
- Equals
- Equals any term
- Contains the phrase
- Contains any term
- Contains all terms
- Starts with
- Starts with any term
- Ends with
- Ends with any term
- Does not equal
- Does not equal any term
- Does not contain the phrase
- Does not contain any term
- Does not contain all terms
- Does not start with
- Does not start with any term
- Does not end with
- Does not end with any term
- Is set
- Is not set
Numeric
- Equals
- Does not equal
- Is greater than
- Is greater than or equal to
- Is less than
- Is less than or equal to
- Is set
- Is not set
Dates
- Equals
- Does not equal
- Is later than
- Is later than or equal to
- Is before
- Is before or equal to
- Is set
- Is not set
- 5 functions per derived field
- 200 operators per derived field. An example of one single operator is ‘Referring Domain contains google’.
Use case 1
You want to define rules to identify various marketing channels, by applying cascading logic to set a marketing channel field to the proper value:
- If the referrer is from a search engine and the page has a query string value where
cid
containsps_
, the marketing channel should be identified as a Paid Search. - If the referrer is from a search engine and the page does not have the query string
cid
, the marketing channel should be identified as a Natural Search. - If a page has a query string value where
cid
containsem_
, the marketing channel should be identified as an Email. - If a page has a query string value where
cid
containsds_
, the marketing channel should be identified as a Display Ad. - If a page has a query string value where
cid
containsso_
, the marketing channel should be identified as a Paid Social. - If the referrer is from a referring domain of twitter.com, facebook.com, linkedin.com, or tiktok.com, the marketing channel should be identified as a Natural Social.
- If none of the above rules are matched, then the marketing channel should be identified as Other Referrer.
In case your site receives the following sample events, containing Referrer and Page URL, these events should be identified as follows:
https://facebook.com
https://site.com/home
https://abc.com
https://site.com/?cid=ds_12345678
https://site.com/?cid=em_12345678
https://google.com
https://site.com/?cid=ps_abc098765
https://google.com
https://site.com/?cid=em_765544332
https://google.com
Data before
https://facebook.com
https://site.com/home
https://abc.com
https://site.com/?cid=ds_12345678
https://site.com/?cid=em_12345678
https://google.com
https://site.com/?cid=ps_abc098765
https://google.com
https://site.com/?cid=em_765544332
https://google.com
Derived field
You define a Marketing Channel
derived field. You use the CASE WHEN functions to define rules that create values for the based on existing values for both the Page URL
and Referring URL
field.
Note the usage of the function URL PARSE to define rules to fetch the values for Page Url
and Referring Url
before the CASE WHEN rules are applied.
Data after
Use case 2
You have collected several different variations of search within your Product Finding Methods dimension. To understand the overall performance of search vs. browse, you must spend a great deal of time combining the results manually.
Your site collects the following values for your Product Finding Methods dimension. In the end, all of these values indicate a search.
Data before
Derived field
You define a Product Finding Methods (new)
derived field. You create the following CASE WHEN rules in rule builder. These rules apply logic to all possible variations of the old Product Finding Methods field values for search
and browse
using the Contains the phrase criterion.
Data after
Use case 3
As a travel company, you would like to bucket trip duration for booked trips so you can report on bucketed lengths of trips.
Assumptions:
- The organization is collecting trip duration into a numeric field.
- They would like to bucket 1-3 day durations into a bucket called ‘short trip’
- They would like to bucket 4-7 day durations into a bucket called ‘medium trip’
- They would like to bucket 8+ day durations into a bucket called ‘long trip’
- 132 trips were booked for a 1-day duration
- 110 trips were booked for a 2-day duration
- 105 trips were booked for a 3-day duration
- 99 trips were booked for a 4-day duration
- 92 trips were booked for a 5-day duration
- 85 trips were booked for a 6-day duration
- 82 trips were booked for a 7-day duration
- 78 trips were booked for an 8-day duration
- 50 trips were booked for a 9-day duration
- 44 trips were booked for a 10-day duration
- 38 trips were booked for an 11-day duration
- 31 trips were booked for a 12-day duration
Your desired report should look like:
Data before
Derived field
You define a Trip Duration (bucketed)
derived field. You create the following CASE WHEN rule in rule builder. This rule applies logic to bucket the old Trip Duration field values into three values: short trip
, medium trip
, and long trip
.
Data after
More information
Customer Journey Analytics uses a nested container structure, modeled after Adobe Experience Platform’s XDM (Experience Data Model). See Containers and Filter containers for more background information. This container model, albeit flexible by nature, imposes some constraints when using the rule builder.
Customer Journey Analytics uses the following default container model:
The following constraints apply and are enforced when selecting and setting values.



Classify
Defines a set of values that are replaced by corresponding values in a new derived field.
Specifications
- String
- Numeric
- Date
-
Field to classify:
- Rules
- Standard fields
- Fields
-
When value equals and Replace values with:
- String
-
Show original values
- Boolean
- 5 functions per derived field
- 200 operators per derived field. Every entry for When value equals original value Replace value with New value is considered an operation.
Use case 1
You do have a CSV-file that includes a key column for hotelID
and one or more additional columns associated with the hotelID
: city
, rooms
, hotel name
.
You are collecting Hotel ID in a dimension but would like to create a Hotel Name dimension derived from the hotelID
in the CSV file.
CSV-file structure and content
Current Report
Desired Report
Data before
Derived field
You define a Hotel Name
derived field. You use the CLASSIFY function to define a rule where you can classify values of the Hotel ID field and replace with new values.
If you want to include original values that you have not defined as part of the values to classify (for example Hotel ID AMS789), ensure you select Show original values. This ensures AMS789 is part of the output for the derived field, despite that value not being classified.
Data after
Use case 2
You have collected URLs instead of the friendly page name for several pages. This mixed collection of values breaks the reporting.
Data before
http://www.adobetravel.ca/Hotel-Search
https://www.adobetravel.com/Package-Search
http://www.adobetravel.ca/user/reviews
https://www.adobetravel.com.br/Generate-Quote/preview
Derived field
You define a Page Name (updated)
derived field. You use the CLASSIFY function to define a rule where you can classify values of your existing Page Name field and replace with updated correct values.
Data after
More information
The following additional functionality is available in the Classify rule interface:
- To quickly clear all table values, select
- To upload a CSV file containing original values for When values equal and new values for Replace values with, select
- To download a template for creating a CSV file with original and new values to upload, select
- To download a CSV file with all original and new values populated in the rule interface, select
Concatenate
Combines field values into a single new derived field with defined delimiters.
Specifications
- String
-
Value:
- Rules
- Standard fields
- Fields
- String
-
Delimiter:
- String
Use case
You currently collect origin and destination airport codes as separate fields. You would like to take the two fields and combine them into a single dimension separated by a hyphen (-). So you can analyze the combination of origin and destination to identify top routes booked.
Assumptions:
- Origin and destination values are collected in separate fields in the same table.
- The user determines to use the delimiter ‘-’ between the values.
Imagine the following bookings occur:
- Customer ABC123 books a flight between Salt Lake City (SLC) and Orlando (MCO)
- Customer ABC456 books a flight between Salt Lake City (SLC) and Los Angeles (LAX)
- Customer ABC789 books a flight between Salt Lake City (SLC) and Seattle (SEA)
- Customer ABC987 books a flight between Salt Lake City (SLC) and San Jose (SJO)
- Customer ABC654 books a flight between Salt Lake City (SLC) and Orlando (MCO)
The desired report should look like:
Data before
Derived field
You define an Origin - Destination
derived field. You use the CONCATENATE function to define a rule to concatenate the Original and Destination fields using the -
Delimiter.
Data after
(derived field)
Deduplicate
Prevents counting a value multiple times.
Specifications
- String
- Numeric
-
Value:
- Rules
- Standard fields
- Fields
- String
-
Scope:
- Person
- Session
-
Deduplication ID:
- Rules
- Standard fields
- Fields
- String
-
Value to keep:
- Keep first instance
- Keep last instance
Use case 1
You want to prevent counting duplicate revenue when a user reloads the booking confirmation page. You use the booking confirmation ID at the identifier to not count the revenue again, when received on the same event.
Data before
Derived field
You define a Booking Confirmation
derived field. You use the DEDUPLICATE function to define a rule to deduplicate the Value Booking for Scope Person using Deduplication ID Booking Confirmation ID. You select Keep first instance as Value to keep.
Data after
Use case 2
You use events as a proxy for campaign click-throughs with external marketing campaigns. Reloads & redirects are causing the event metric to be inflated. You would like to deduplicate the tracking code dimension so only the first is collected and minimize the event overcounting.
Data before
Derived field
You define a new Tracking Code (deduplicated)
derived field. You use the DEDUPLICATE function to define a rule to deduplicate the Tracking Code with a Deduplication scope of Session and Keep first instance as the Value to keep.
Data after
Find and Replace
Finds all values in a selected field and replaces those values with a different value in a new derived field.
Specifications
- String
-
Value
- Rules
- Standard fields
- Fields
-
Find all, and replace all with:
- String
Strings
- Find all, and replace all with
Use case
You have received some malformed values for your external marketing channels report, for example email%20 marketing
instead of email marketing
. These malformed values fracture your reporting and make it more difficult to see how email is performing. You want to replace email%20marketing
with email marketing
.
Original Report
Preferred Report
Data before
Derived field
You define an Email Marketing (updated)
derived field. You use the FIND AND REPLACE function to define a rule to find and replace all occurrences of email%20marketing
with email marketing
.
Data after
Lookup
Lookup values using a field from a lookup dataset and returns a value in a new derived field or for further rule processing.
Specification
- String
- Numeric
- Date
-
Field to apply lookup:
-
- Rules
- Standard fields
- Fields Lookup dataset
-
- Dataset
Matching key
- Rules
- Fields
-
Values to return
- Rules
- Fields
Use case
You would like to lookup the activity name using the activity id collected when your customers clicked on a personalized banner shown through Adobe Target. You want to use a lookup dataset with Analytics for Target (A4T) activities containing activity ids and activity names.
A4T lookup dataset
Derived field
You define an Activity Name
derived field. You use the LOOKUP function to define a rule to lookup the value from your collected data, specified in the Field to apply lookup field (for example ActivityIdentifier). You select the lookup dataset from the Lookup dataset list (for example New CJA4T Activities). Then you selecting the identifier field (for example ActivityIdentifier) from the Matching key list and the field to return from the Values to return list (for example ActivityName).
More information
The Lookup function is applied at report time to the data retrieved by Customer Journey Analytics from the lookup dataset you have configured as part of your connection.
You can quickly insert a Lookup function in the rule builder, already containing one or more other functions.
- Select Schema fields from selector.
- Select
- Select your lookup dataset and find the field you want to use for lookup.
- Drag and drop the lookup field on any of the available input fields for a function (for example Case When). When valid, a blue box, labeled + Add, allows you to drop the field and automatically insert a Lookup function before the function you dropped the lookup field on. The inserted Lookup function is automatically populated with relevant values for all fields.
Lowercase
Converts values from a field to lowercase and stores it into a new derived field.
Specification
- String
- Numeric
- Date
- Field:
- Rules
- Standard fields
- Fields
Use case
You would like to convert all collected product names into lowercase for proper reporting.
Data before
Derived field
You define a Product Names
derived field. You use the LOWERCASE function to define a rule to convert the value from the Collected Product Names field to lowercase and store that in the new derived field.
Data after
Math
Use basic mathematical operators (add, subtract, multiply, divide & raise to a power) on numeric fields.
Specification
- Numeric
- One or multiple numeric fields
- One or multiple operators (add, subtract, multiply, divide, raise to a power)
- User input value
+
(add)-
(subtract)*
(multiply)/
(divide)^
(raise to power)
- 25 operations per derived field
- 5 Math functions per derived field
Use case
Due to inflation you want to correct the revenue numbers of ingested CRM data with 5% inflation.
Data before
Derived field
You define a Corrected Annual Revenue
derived field. You use the MATH function to define a rule that multiplies the original Annual Revenue number with 1.05.
Data after
More information
To create a formula:
-
Simply start typing in the Formula field and numeric fields that match what you type will appear in a popup menu. Alternatively, you can drag and drop a numeric field from the available fields in the left pane.
-
Add the operand (for example
*
to multiply) followed by another field or a static value. You can use parenthesis to define more complex formulas. -
To insert a static value (for example
1.05
), type the value and select Add x as a static value or Add -x as a negative static value from the popup menu.
-
A green checkmark
There are some important considerations when working with static numbers in the MATH function:
-
Static values need to be associated with a field. For example, using the MATH function with only static fields is not supported.
-
You cannot use the raise to power operator (
ˆ
) on a static value. -
If you are using multiple static values in a formula, these static values should be grouped using parenthesis for the formula to be valid. For example:
-
This formula returns an error.
-
This formula is valid.
-
Use the Math function for hit-level based calculations. Use the Summarize function for event, session or person scope based calculations.
Merge Fields
Merges values from two different fields into a new derived field.
Specification
- String
- Numeric
- Date
- Field:
- Rules
- Standard fields
- Fields
Use case
You would like to create a dimension made up from the page name field and the call reason field with the intent of analyzing the journey across channels.
Data before
Derived field
You define a Cross Channel Interactions
derived field. You use the MERGE FIELDS function to define a rule to merge the values from the Page Name field and Call Reason field and store that in the new derived field.
Data after
More information
You must select the same type of fields within a Merge Fields rule. For example, if you select a Date field, all other fields you want to merge have to be Date fields.
Next or Previous
Takes a field as input and resolves the next or previous value for that field within the scope of the session or use. This will only apply to the Visit and Event table fields.
Specification
- String
- Numeric
- Date
-
Field:
-
- Rules
- Standard fields
- Fields
Method:
- Previous value
- Next value
-
Scope:
- Person
- Session
-
Index:
- Numeric
-
Include repeats:
- Boolean
Use case
You would like to understand what the next or previous value is of the data that you receive, taken into account repeat values.
Data
Example 1 - Handling include repeats
Session
Index = 1
Include Repeats
Session
Index = 1
NOT Include Repeats
Session
Index = 1
Include Repeats
Session
Index = 1
NOT Include Repeats
Example 2 - Handling include repeats with blank values in data received
Session
Index = 1
Include Repeats
Session
Index = 1
NOT Include Repeats
Session
Index = 1
Include Repeats
Session
Index = 1
NOT Include Repeats
Derived field
You define a Next Value
or Previous value
derived field. You use the NEXT OR PREVIOUS function to define a rule that selects the Data received field, select Next value or Previous value as Method, Session as Scope and set the value of Index to 1
.
More information
You can only select fields that belong to the Visit or Event table.
Include repeats determines how to handle repeating values for the NEXT OR PREVIOUS function.
-
Include repeats looks and the next or previous values. If Include Repeats is selected, it will ignore any sequential repeats of next or previous values from the current hit.
-
Rows with no (blank) values for a selected field will not have next or previous values returned as part of the NEXT OR PREVIOUS function output.
Regex Replace
Replaces a value from a field using a regular expression into a new derived field.
Specification
- String
- Numeric
- Field:
- Rules
- Standard fields
- Fields
- Regex:
-
- String Output Format:
- String
- Case sensitive
- Boolean
Use case
You would like to grab a potion of a URL and use that as a unique page identifier to analyze traffic. You use [^/]+(?=/$|$)
for the regular expression to capture the end of the URL and $1
as the output pattern.
Data before
https://business.adobe.com/products/analytics/adobe-analytics-benefits.html
https://business.adobe.com/products/analytics/adobe-analytics.html
https://business.adobe.com/products/experience-platform/customer-journey-analytics.html
https://business.adobe.com/products/experience-platform/adobe-experience-platform.html
Derived field
You create a Page Identifier
derived field. You use the REGEX REPLACE function to define a rule to replace value of the Referring URL field using a Regex of [^/]+(?=/$|$)
and Output format of $1
.
Data after
More information
Customer Journey Analytics uses a subset of the Perl regex syntax. The following expressions are supported:
a
a
.a|b
a
or b
.[abc]
a
, b
, or c
.[^abc]
a
, b
, or c
.[a-z]
a
-z
.[a-zA-Z0-9]
a
-z
, A
-Z
, or digits 0
-9
.^
$
\A
\z
.
\s
\S
\d
\D
\w
\W
\b
\B
\<
\>
(...)
(?:...)
a?
a
.a*
a
.a+
a
.a{3}
a
.a{3,}
a
.a{3,6}
a
.You can use these sequences in the Output format any number of times and in any order to achieve the desired string output.
$&
$n
$1
outputs the first sub-expression.$`
$+
$$
"$"
.Split
Splits a value from a field into a new derived field.
Specification
- String
- Numeric
- Field:
- Rules
- Standard fields
- Fields
- Method:
-
- From the left
- From the right
- Convert to array For Delimiter:
- String
- For Index:
- Numeric
Use case 1
You collect voice app responses into a delimited list in a single dimension. You would like each value in the list to be a unique value in the responses report.
Data before
Derived field
You create a Responses
derived field. You use the SPLIT function to define a rule to use the Convert to array method to convert the values from the Voice App Response field using ,
as the Delimiter.
Data after
Use case 2
You collect voice app responses into a delimited list in a single dimension. You would like the responses from the first value in the list into its own dimension. You would like to put the last value in the list into its own dimension.
Data before
Derived field
You create a First Response
derived field. You use the SPLIT function to define a rule to take the first value from the Responses field from the left of the response ,
as the delimiter.
You create a Second Response
derived field to take the last value from the Responses field by selecting From the right, 1 as the Delimiter and 1 as the Index.
Data after
Summarize
Applies aggregation-type functions to metrics or dimensions at event, session, and user levels.
Specification
- String
- Numeric
- Date
-
Value
- Rules
- Standard fields
- Fields
-
Summarize methods
-
Scope
- Event
- Session
- Person
-
Numeric
- MAX - return largest value from a set of values
- MIN - returns smallest value from a set of values
- MEDIAN - returns median for a set of values
- MEAN - returns average for a set of values
- SUM - returns the sum for a set of values
- COUNT - returns the number of values received
- DISTINCT - returns set of distinct values
-
Strings
- DISTINCT - returns set of distinct values
- COUNT DISTINCT - returns the number of distinct values
- MOST COMMON - returns the string value most often received
- LEAST COMMON - returns the string value least often received
- FIRST - The first value received; only applicable for the session & event tables
- LAST- The last value received; only applicable for the session & event tables
-
Dates
- DISTINCT - returns set of distinct values
- COUNT DISTINCT - returns the number of distinct values
- MOST COMMON - returns the string value most often received
- LEAST COMMON - returns the string value least often received
- FIRST - The first value received; only applicable for the session & event tables
- LAST- The last value received; only applicable for the session & event tables
- EARLIEST - The earliest value received (determined by time); only applicable for the session & event tables
- LATEST - The latest value received (determined by time); only applicable for the session & event tables
Use case
You would like to categorize Add to Cart Revenue into three different categories: Small, Medium, and Large. This allows you to analyze and identify the characteristics of high-value customers.
Data before
Assumptions:
- Add to Cart Revenue is collected as a numeric field.
Scenarios:
- CustomerABC123 adds $35 to their cart for ProductABC, then separately adds ProductDEF to their cart for $75.
- CustomerDEF456 adds $50 to their cart for ProductGHI, then separately adds ProductJKL to their cart for $275.
- CustomerGHI789 adds $500 to their cart for ProductMNO.
Logic:
- If Total Add to Cart Revenue for a visitor is less than $150, set to Small.
- If Total Add to Cart Revenue for a visitor is greater than $150, but less than $500, set to Medium.
- If Total Add to Cart Revenue for a visitor is greater than or equal to $500, set to Large.
Results:
- Total Add to Cart Revenue for $110 for CustomerABC123.
- Total Add to Cart Revenue for $325 for CustomerDEF456.
- Total Add to Cart Revenue for $500 for CustomerGHI789.
Derived field
You create an Add To Cart Revenue Size
derived field. You use the SUMMARIZE function and the Sum Summarize method with Scope set to Person to sum the values of the cart_add field. Then you use a second CASE WHEN rule to split the result in the tree category sizes.
Data after
More information
Use the Summarize function for event, session or person scope based calculations. Use the Math function for hit-level based calculations.
Trim
Trims whitespace, special characters, or number of characters from either the beginning or the end of field values into a new derived field.
Specification
- String
-
Field
- Rules
- Standard fields
- Fields
-
Trim whitespace
-
Trim special characters
- Input of special characters
-
Trim from left
-
From
-
String start
-
Position
- Position #
-
String
- String value
- Index
- Flag to include string
-
-
To
-
String end
-
Position
- Position #
-
String
- String value
- Index
- Flag to include string
-
Length
-
-
-
Trim from right
-
From
-
String end
-
Position
- Position #
-
String
- String value
- Index
- Flag to include string
-
-
To
-
String start
-
Position
- Position #
-
String
- String value
- Index
- Flag to include string
-
Length
-
-
Use case 1
You collect product data, however that data contains hidden whitespace characters which fragment reporting. You would like to easily trim any excess whitespace
Data before
"prod12356 "
"prod12356"
" prod12356"
Derived field
You create a Product Identifier
derived field. You use the TRIM function to define a rule to Trim whitespace from the Product ID field.
Data after
"prod12356"
Use case 2
Your data on page names collected includes some erroneous special characters at the end of the page name which must be removed.
Data before
Derived field
You create a Page Name
derived field. You use the TRIM function to define a rule to Trim special characters from the Name field using the Special characters #?%&/
.
Data after
Use case 3
You collect data including a storeID. The storeID contains the abbreviated US state code as the first two characters. You want to only use that state code in your reporting.
Data before
Derived field
You create a Store Identifier
derived field. You use the TRIM function to define a rule to Truncate from right the storeID field from String end to position 3
.
Data after
URL Parse
Parses out different parts of a URL including protocol, host, path, or query parameters.
Specifications
- String
-
Field:
-
- Rules
- Standard fields
- Fields
Option:
- Get protocol
- Get host
- Get path
- Get query string value
- Query parameter:
- String
- Query parameter:
- Get hash value
Use case 1
You only want use the referring domain from the referring URL as part of a marketing channel’s set of rules.
Data before
https://www.google.com/
https://duckduckgo.com/
https://t.co/
https://l.facebook.com/
Derived field
You define a Referring Domain
derived field. You use the URL PARSE function to define a rule to fetch the host from the Referring URL field and store that in the new derived field.
Data after
Use case 2
You want to use the value of the cid
parameter of a query string in a Page URL as part of the output of a derived tracking code report.
Data before
https://www.adobe.com/?cid=abc123
https://www.adobe.com/?em=email1234&cid=def123
https://www.adobe.com/landingpage?querystring1=test&test2=1234&cid=xyz123
Derived field
You define a Query String CID
derived field. You use the URL PARSE function to define a rule to fetch the value of the query string parameter in the Page URL field, specifying cid
as the query parameter. The output value is stored in the new derived field.
Data after
Limitations
The following limitations apply to the Derived field functionality in general:
- You can use a maximum of ten different schema fields (not including standard fields) when defining rules for a derived field.
- From this maximum of ten different schema fields, only a maximum of three lookup schema or profile schema fields are allowed.
- You can have a maximum of 100 derived fields per Customer Journey Analytics connection.
Summary of function limitations
- 5 Case When functions per derived field
- 200 operators per derived field
- 5 Classify functions per derived field
- 200 operators per derived field
- 2 Concatenate functions per derived field
- 5 Deduplicate functions per derived field
- 2 Find & Replace functions per derived field
- 5 Lookup functions per derived field
- 2 Lowercase functions per derived field
- 25 operations per derived field
- 5 Math functions per derived field
- 2 Merge Fields functions per derived field
- 3 Next or Previous functions per derived field
- 1 Regex Replace function per derived field
- 5 Split functions per derived field
- 3 Summarize functions per derived field
- 1 Trim function per derived field
- 5 URL Parse functions per derived field
Operators
An operator in an If or Else If construct within a Case When function is the combination of a criterion with one value. Every additional value for the criterion adds to the number of operators.
As an example, the condition below uses 13 operators.
An operator in the Classify function is a single entry for When value equal Original value Replace value with New value.
As an example, the Classify rule below uses 3 operators.
More information
Trim
and Lowercase
are features already available in the component settings in Data views. Using Derived Fields allows you to combine these functions to do more complex data transformation directly in Customer Journey Analytics. For example, you can use Lowercase
to remove case sensitivity in an event field, and then use Lookup
to match the new lowercase field to a lookup dataset that only has lookup keys in lowercase. Or you can use Trim
to remove characters before setting up Lookup
on the new field.
Support for lookup and profile fields in Derived Fields enables you to transform data based on event lookups and profile attributes. This can be especially helpful in B2B scenarios with account-level data in lookup or profile datasets. Additionally, this support is useful to manipulate data in common fields from lookup data (like campaign info and offer type), or from profile data (like member tier and account type).