The Real-Time Customer Data Platform Insights Data Model for the B2C Edition exposes the data models and SQL that power the insights for various profile, destination, and segmentation widgets. You can customize these SQL query templates to create Real-Time CDP reports for your marketing and key performance indicator (KPI) use cases. These insights can then be used as custom widgets for your user-defined dashboards. See the query accelerated store reporting insights documentation to learn how to build a reporting insights data model through Query Service for use with accelerated store data and user-defined dashboards.
NOTE
The term ‘segment’ has been updated to ‘audience’ across Adobe Experience Platform systems. Some references to segments remain in use for file paths and dataset naming conventions.
Prerequisites
This guide requires a working understanding of the user-defined dashboards feature. Please read the documentation before continuing with this guide.
Real-Time CDP insight reports and use cases
Real-Time CDP reporting provides insights into your profile data and its relationship with audiences and destinations. Various star schema models were developed to answer a variety of common marketing use cases and each data model can support several use cases.
IMPORTANT
The data used for Real-Time CDP reporting is accurate for a chosen merge policy and from the most recent daily snapshot.
Profile model profile-model
The profile model is comprised of three datasets:
adwh_dim_date
adwh_fact_profile
adwh_dim_merge_policies
The image below contains the relevant data fields in each dataset.
The profile count use case profile-count
The logic used for the Profile count widget returns the total number of merged profiles within the Profile store at the time the snapshot was taken. See the Profile count widget documentation for more information.
The SQL that generates the Profile count widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT qsaccel.profile_agg.adwh_dim_merge_policies.merge_policy_name,
sum(qsaccel.profile_agg.adwh_fact_profile.count_of_profiles) CNT
FROM qsaccel.profile_agg.adwh_fact_profile
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_merge_policies ON qsaccel.profile_agg.adwh_dim_merge_policies.merge_policy_id=adwh_fact_profile.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile.date_key='2024-01-10'
AND qsaccel.profile_agg.adwh_fact_profile.merge_policy_id = 2027892989
GROUP BY qsaccel.profile_agg.adwh_dim_merge_policies.merge_policy_name;
The single identity profiles use case single-identity-profiles
The logic used for the Single identity profiles widget provides a count of your organization’s profiles that only have one type of ID type that creates their identity. See the Single identity profiles widget documentation for more information.
The SQL that generates the Single identity profiles widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT qsaccel.profile_agg.adwh_dim_merge_policies.merge_policy_name,
sum(qsaccel.profile_agg.adwh_fact_profile.count_of_Single_Identity_profiles) CNT
FROM qsaccel.profile_agg.adwh_fact_profile
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_merge_policies ON qsaccel.profile_agg.adwh_dim_merge_policies.merge_policy_id=adwh_fact_profile.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile.date_key='2024-01-10'
AND qsaccel.profile_agg.adwh_fact_profile.merge_policy_id = 2027892989
GROUP BY qsaccel.profile_agg.adwh_dim_merge_policies.merge_policy_name;
Namespace model namespace-model
The namespace model is comprised of the following datasets:
adwh_dim_date
adwh_fact_profile_by_namespace
adwh_dim_merge_policies
adwh_dim_namespaces
The image below contains the relevant data fields in each dataset.
Profiles by identity use case profiles-by-identity
The Profiles by identity widget displays the breakdown of identities across all of the merged profiles in your Profile store. See the Profiles by identity widget documentation for more information.
The SQL that generates the Profiles by identity widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT qsaccel.profile_agg.adwh_dim_namespaces.namespace_description,
sum(qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.count_of_profiles) count_of_profiles
FROM qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = 2027892989
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.date_key = '2024-01-10'
GROUP BY qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.date_key,
qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id,
qsaccel.profile_agg.adwh_dim_namespaces.namespace_description
ORDER BY count_of_profiles DESC;
Single identity profiles by identity use case single-identity-profiles-by-identity
The logic used for the Single identity profiles by identity widget illustrates the total number of profiles that are identified with only a single unique identifier. See the Single identity profiles by identity widget documentation for more information.
The SQL that generates the Single identity profiles by identity widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT qsaccel.profile_agg.adwh_dim_namespaces.namespace_description,
sum(qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.count_of_Single_Identity_profiles) count_of_Single_Identity_profiles
FROM qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = 2027892989
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.date_key = '2024-01-10'
GROUP BY qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.date_key,
qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id,
qsaccel.profile_agg.adwh_dim_namespaces.namespace_description;
Audience model audience-model
The audience model is comprised of the following datasets:
adwh_dim_date
adwh_fact_profile_by_segment
adwh_dim_merge_policies
adwh_dim_segments
adwh_dim_br_segment_destinations
adwh_dim_destination
adwh_dim_destination_platform
The image below contains the relevant data fields in each dataset.
Audience size use case audience-size
The logic used for the Audience size widget returns the total number of merged profiles within the selected audience at the time of the most recent snapshot. See the Audience size widget documentation for more information.
The SQL that generates the Audience size widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT
sum(
qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines.count_of_profiles
) count_of_profiles
FROM
qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_segments ON qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines.segment_id = qsaccel.profile_agg.adwh_dim_segments.segment_id
WHERE
qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines.segment_id = -1323307941
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines.merge_policy_id = 1914917902
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines.date_key = '2024-01-12';
Audience size change trend use case audience-size-change-trend
The logic used for the Audience size change trend widget provides a line graph illustration of the difference in the total number of profiles that qualified for a given audience between the most recent daily snapshots. See the Audience size change trend widget documentation for more information.
The SQL that generates the Audience size change trend widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT date_key,
Profiles_added
FROM
(SELECT rn_num,
date_key,
(count_of_profiles-lag(count_of_profiles, 1, 0) over(
ORDER BY date_key))Profiles_added
FROM
(SELECT date_key,
sum(x.count_of_profiles)count_of_profiles,
row_number() OVER (
ORDER BY date_key) rn_num
FROM qsaccel.profile_agg.adwh_fact_profile_by_segment_trendlines x
INNER JOIN
(SELECT MAX(process_date) last_process_date,
merge_policy_id
FROM qsaccel.profile_agg.adwh_lkup_process_delta_log
WHERE process_name = 'FACT_TABLES_PROCESSING'
AND process_status = 'SUCCESSFUL'
GROUP BY merge_policy_id) y ON x.merge_policy_id = y.merge_policy_id
WHERE segment_id = 1333234510
AND x.date_key >= dateadd(DAY, -30 -1, y.last_process_date)
GROUP BY x.date_key) a)b
WHERE rn_num > 1;
Most used destinations use case most-used-destinations
The logic used in the Most used destinations widget lists your organization’s most used destinations according to the number of audiences mapped to them. This ranking provides insight into which destinations are being utilized while also potentially showing those that may be underutilized. See the documentation on the Most used destinations widget for more information.
The SQL that generates the Most used destinations widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT qsaccel.profile_agg.adwh_dim_destination.destination_name,
qsaccel.profile_agg.adwh_dim_destination.destination_id,
qsaccel.profile_agg.adwh_dim_destination.destination,
count(DISTINCT qsaccel.profile_agg.adwh_dim_br_segment_destinations.segment_id) segment_count
FROM qsaccel.profile_agg.adwh_dim_destination
JOIN qsaccel.profile_agg.adwh_dim_br_segment_destinations ON qsaccel.profile_agg.adwh_dim_destination.destination_id = qsaccel.profile_agg.adwh_dim_br_segment_destinations.destination_id
WHERE qsaccel.profile_agg.adwh_dim_destination.destination_name IS NOT NULL
GROUP BY qsaccel.profile_agg.adwh_dim_destination.destination_name,
qsaccel.profile_agg.adwh_dim_destination.destination,
qsaccel.profile_agg.adwh_dim_destination.destination_id
ORDER BY segment_count DESC
LIMIT 20;
Recently activated audiences use case recently-activated-audiences
The logic for the Recently activated audiences widget provides a list of the audiences most recently mapped to a destination. This list provides a snapshot of the audiences and destinations that are actively in use in the system and can help in troubleshooting any erroneous mappings. See the Recently activated audiences widget documentation for more information.
The SQL that generates the Recently activated audiences widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT
segment_name,
segment,
destination_name,
a.create_time create_time
FROM
qsaccel.profile_agg.adwh_dim_br_segment_destinations a
INNER JOIN qsaccel.profile_agg.adwh_dim_segments b ON a.segment_id = b.segment_id
INNER JOIN qsaccel.profile_agg.adwh_dim_destination c ON a.destination_id = c.destination_id
ORDER BY
create_time DESC,
segment
LIMIT
20;
Namespace-audience model namespace-audience-model
The namespace-audience model is comprised of the following datasets:
adwh_dim_date
adwh_dim_namespaces
adwh_fact_profile_by_segment_and_namespace
adwh_dim_merge_policies
adwh_dim_segments
adwh_dim_br_segment_destinations
adwh_dim_destination
adwh_dim_destination_platform
The image below contains the relevant data fields in each dataset.
Profiles by identity for an audience use case audience-profiles-by-identity
The logic used in the Profiles by identity widget provides a breakdown of identities across all of the merged profiles in your Profile store for a given audience. See the Profiles by identity widget documentation for more information.
The SQL that generates the Profiles by identity widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT qsaccel.profile_agg.adwh_dim_namespaces.namespace_description,
sum(qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.count_of_profiles) count_of_profiles
FROM qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.segment_id = 1333234510
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.merge_policy_id = 1709997014
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.date_key = '2024-01-10'
GROUP BY qsaccel.profile_agg.adwh_dim_namespaces.namespace_description
ORDER BY count_of_profiles DESC;
Overlap namespace model
The overlap namespace model is comprised of the following datasets:
adwh_dim_date
adwh_dim_overlap_namespaces
adwh_fact_profile_overlap_of_namespace
adwh_dim_merge_policies
The image below contains the relevant data fields in each dataset.
Identity overlap (profiles) use case profiles-identity-overlap
The SQL that generates the Identity overlap widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT Sum(overlap_col1) overlap_col1,
Sum(overlap_col2) overlap_col2,
coalesce(Sum(overlap_count), 0) overlap_count
FROM
(SELECT 0 overlap_col1,
0 overlap_col2,
Sum(count_of_profiles) overlap_count
FROM qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace
WHERE qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace.merge_policy_id = 2027892989
AND qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace.date_key = '2024-01-10'
AND qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace.overlap_id IN
(SELECT a.overlap_id
FROM
(SELECT qsaccel.profile_agg.adwh_dim_overlap_namespaces.overlap_id overlap_id,
count(*) cnt_num
FROM qsaccel.profile_agg.adwh_dim_overlap_namespaces
WHERE qsaccel.profile_agg.adwh_dim_overlap_namespaces.merge_policy_id = 2027892989
AND qsaccel.profile_agg.adwh_dim_overlap_namespaces.overlap_namespaces in ('avid',
'crmid')
GROUP BY qsaccel.profile_agg.adwh_dim_overlap_namespaces.overlap_id)a
WHERE a.cnt_num>1 )
UNION ALL SELECT count_of_profiles overlap_col1,
0 overlap_col2,
0 overlap_count
FROM qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines
JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = 2027892989
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.date_key = '2024-01-10'
AND qsaccel.profile_agg.adwh_dim_namespaces.namespace_description = 'avid'
UNION ALL SELECT 0 overlap_col1,
count_of_profiles overlap_col2,
0 Overlap_count
FROM qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines
JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.merge_policy_id = 2027892989
AND qsaccel.profile_agg.adwh_fact_profile_by_namespace_trendlines.date_key = '2024-01-10'
AND qsaccel.profile_agg.adwh_dim_namespaces.namespace_description = 'crmid' )a;
Overlap Namespace by audience model overlap-namespace-by-audience-model
The overlap namespace by audience model is comprised of the following datasets:
adwh_dim_date
adwh_dim_overlap_namespaces
adwh_fact_profile_overlap_of_namespace_by_segment
adwh_dim_merge_policies
adwh_dim_segments
adwh_dim_br_segment_destinations
adwh_dim_destination
adwh_dim_destination_platform
The image below contains the relevant data fields in each dataset.
Identity overlap (audiences) use case audiences-identity-overlap
The SQL that generates the Identity overlap widget is seen in the collapsible section below.
SQL query
code language-sql
SELECT Sum(overlap_col1) overlap_col1,
Sum(overlap_col2) overlap_col2,
Sum(overlap_count) Overlap_count
FROM
(SELECT 0 overlap_col1,
0 overlap_col2,
Sum(count_of_profiles) Overlap_count
FROM qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace_by_segment
WHERE qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace_by_segment.segment_id = 1333234510
AND qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace_by_segment.merge_policy_id = 1709997014
AND qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace_by_segment.date_key = '2024-01-10'
AND qsaccel.profile_agg.adwh_fact_profile_overlap_of_namespace_by_segment.overlap_id IN
(SELECT a.overlap_id
FROM
(SELECT qsaccel.profile_agg.adwh_dim_overlap_namespaces.overlap_id overlap_id,
count(*) cnt_num
FROM qsaccel.profile_agg.adwh_dim_overlap_namespaces
WHERE qsaccel.profile_agg.adwh_dim_overlap_namespaces.merge_policy_id = 1709997014
AND qsaccel.profile_agg.adwh_dim_overlap_namespaces.overlap_namespaces in ('crmid',
'email')
GROUP BY qsaccel.profile_agg.adwh_dim_overlap_namespaces.overlap_id)a
WHERE a.cnt_num>1 )
UNION ALL SELECT count_of_profiles overlap_col1,
0 overlap_col2,
0 Overlap_count
FROM qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_dim_namespaces.namespace_description = 'crmid'
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.segment_id = 1333234510
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.merge_policy_id = 1709997014
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.date_key = '2024-01-10'
UNION ALL SELECT 0 overlap_col1,
count_of_profiles overlap_col2,
0 Overlap_count
FROM qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines
LEFT OUTER JOIN qsaccel.profile_agg.adwh_dim_namespaces ON qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.namespace_id = qsaccel.profile_agg.adwh_dim_namespaces.namespace_id
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.merge_policy_id = qsaccel.profile_agg.adwh_dim_namespaces.merge_policy_id
WHERE qsaccel.profile_agg.adwh_dim_namespaces.namespace_description = 'email'
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.segment_id = 1333234510
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.merge_policy_id = 1709997014
AND qsaccel.profile_agg.adwh_fact_profile_by_segment_and_namespace_trendlines.date_key = '2024-01-10' ) a;