Apply data transformations for data feeds

AVAILABILITY
The functionality described in this article is in the Limited Testing phase of release and might not be available yet in your environment. This note will be removed when the functionality is generally available. For information about the Customer Journey Analytics release process, see Customer Journey Analytics feature releases.

You can transform your data feed data using any of the following methods:

Each method has advantages and disadvantages. The following sections compare the tradeoffs both generally and for specific transformations.

Compare data transformation methods generally

The following table compares the advantages and disadvantages of each method in general.

Method
Advantages
Disadvantages
Component settings
  • Applied at report time, before your data feed is delivered.
  • The same logic applies consistently in both Analysis Workspace and your data feed output.
  • Doesn’t consume one of your account’s limited derived fields.
  • There’s no limit on the number of component settings you can use.
  • Adds processing overhead, which can affect data feed delivery performance
  • Only available for the specific set of settings each component supports. Not as flexible as building custom logic with a derived field.
Derived fields
  • Applied at report time, before your data feed is delivered.
  • The same logic applies consistently in both Analysis Workspace and your data feed output.
  • Supports more flexible, custom logic than any single component setting, such as chained conditional rules.
  • Some transformations, particularly those that depend on a Scope setting or that parse a URL, are difficult to replicate in SQL.
  • Adds processing overhead, which can affect data feed delivery performance
  • Adds processing overhead, which can affect data feed delivery performance.
  • Uses one of your account’s limited derived fields. If a component setting can do the same transformation, use that instead.
SQL
  • Not limited by the function and operator limits that apply to derived fields.
  • Has no effect on data feed delivery performance.
  • Applied after your data feed is already delivered.
  • Logic doesn’t apply in Analysis Workspace, so you need to duplicate it there separately.
  • Some transformations are difficult or impractical to replicate, particularly those that depend on a Scope setting, that parse a URL, or that deduplicate or persist a value across a scope.

Compare data transformation methods by transformation type

The following table lists specific data transformations, showing which method (or methods) can perform each one, how difficult it would be to replicate in SQL, and which method is recommended.

Transformation
Component setting (in CJA)
Derived field (in CJA)
Recommended method (in CJA)
Difficulty in SQL
Considerations
Apply conditional logic or filter values by criteria
Include exclude values
Case When

Component setting

Recommended because it doesn’t consume one of your limited derived fields.

Easy for strings

Moderate to difficult for metrics (requires a CASE statement combined with a COUNT)

Attribute credit for a success event
Attribution
Not available
Component setting
Not applicable
Applies only to dimensions in data feeds. For metrics, there’s no data feed behavior to replicate.
Bucket numeric values into ranges
Value bucketing
Manual Case When

Component setting

Recommended for ease of use and because it doesn’t consume one of your limited derived fields.

Difficult
Complexity increases from component setting (easiest) to derived field (moderate, using a manual Case When) to SQL (most complex).
Classify values using a lookup-style mapping
Not available
Classify

Derived field

Recommended because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate
Combine field values with a delimiter
Not available
Concatenate

Derived field

Recommended because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate
Mirrors the functionality of adding multiple dimension columns to a freeform table, which is limited to Full Table Export. A derived field makes similar output available in a data feed.
Convert a field’s data type
Not available
Typecast

Derived fields

Recommended because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate
Count metric occurrences (values vs. instances)
Behavior
Custom Math-based workaround

Component setting

Recommended because:

  • The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
  • It doesn’t consume one of your limited derived fields.
Easy / Moderate
Deduplicate a value within a scope
Metric deduplication
Deduplicate

Component setting

Recommended because it doesn’t consume one of your limited derived fields.

Difficult
Depends on a Scope setting. See How Scope settings affect data feeds.
Determine a field’s depth within a session
Not available
Depth

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Difficult

Depends on a Scope setting (uses session as the scope, and it is not configurable). See How Scope settings affect data feeds.

Find and replace a literal value
Not available
Find and Replace

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate
Format a value for display
Format
Not available

Component setting

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Difficult
Group dimensions from summary datasets
Not applicable
Not applicable
Not applicable
Not applicable
Summary data groups apply only to summary datasets, which aren’t used with data feeds. This transformation doesn’t apply to data feed output.
Handle a blank (“no value”) field
No value options
The Treat “No value” as a value option applies to data feeds, while the Don’t show “No value” by default and Show “No value” by default options do not apply to data feeds.
Not available
Component setting
Not possible
All “No values” are returned as nulls in the final data feed output, rather than as a “No value” string.
Look up a value from a lookup dataset
Not available
Lookup

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate

A lookup table must already exist.

Lowercase a string
Behavior
Lowercase

Component setting

Recommended because:

  • The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
  • It doesn’t consume one of your limited derived fields.
Easy / Moderate
Merge multiple fields into one
Not available
Merge Fields

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate
Parse a URL into its components
Substring (URL parse method)
URL Parse

Component setting

Recommended because it doesn’t consume one of your limited derived fields.

Difficult

Requires custom string parsing to extract the same components.

Perform basic math on numeric fields
Not available
Math

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Easy / Moderate
Persist a dimension value across events
Persistence
Not currently available

Component setting

Recommended for ease of use and because it doesn’t consume one of your limited derived fields.

Difficult
Interacts with the lookback date range the same way Scope-dependent derived field functions do. See Understand the lookback date range.
Replace a value using a regular expression
Substring (Regex method)
Regex Replace

Component setting

All three approaches produce the same result, but prefer the component setting because:

  • The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
  • It doesn’t consume one of your limited derived fields.
Easy / Moderate
Resolve the next or previous value in a session
Not available
Next or Previous

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Difficult
Depends on a Scope setting. See How Scope settings affect data feeds.
Return the difference between two dates
Not available
Date Math

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Difficult
Depends on a Scope setting. See How Scope settings affect data feeds.
Scope a metric as event-, profile-, or total-based
Scope
Not available
Split a delimited value
Substring (Delimiter or From the Left/Right method)
Split

Component setting

Recommended because:

  • The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
  • It doesn’t consume one of your limited derived fields.
Easy / Moderate
Summarize or aggregate a value across a scope
Not available
Summarize

Derived field

Recommended for ease of use and because the same logic applies consistently in both Analysis Workspace and your data feed output.

Difficult
Depends on a Scope setting. See How Scope settings affect data feeds.
Trim characters from a string
Substring (Trim method)
Trim

Component setting

Recommended because:

  • The same logic applies consistently in both Analysis Workspace and your data feed output (not possible with SQL)
  • It doesn’t consume one of your limited derived fields.
Easy / Moderate

How Scope settings affect data feeds scope-settings

Date Math, Deduplicate, Next or Previous, and Summarize each depend on a Scope setting of Event, Session, or Person (the available options vary by function). Depth has no configurable Scope field, but is inherently tied to the session, similar to the standard Event Depth dimension. Any field with a scope writes the same value to every row within that scope, and that value depends on the data within the lookback date range.

Because the lookback date range slides forward with each data feed delivery, the same field can return a different value on a later delivery, even for events that already occurred.

Risk increases with scope size: Person scope carries more risk than Session scope, because a person’s history has no natural time boundary within a feed run.

Derived field function templates

Derived field function templates let you quickly create a derived field for a specific use case, such as building marketing channels, detecting bots, or extracting a UTM parameter from a URL. Because a template is built from a chain of pre-built rules, using one is almost always preferable to reproducing the same logic in SQL from scratch, as with the Marketing Channel Template.

If a template includes a function that depends on a Scope setting, the template inherits that function’s scope caution. See How Scope settings affect data feeds.

recommendation-more-help
analytics-platform-help-main