<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Akash on Medium]]></title>
        <description><![CDATA[Stories by Akash on Medium]]></description>
        <link>https://medium.com/@akashkumar2602?source=rss-4c2424864d5e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*i7NGoQOApFmNzWjUSoTRYw.jpeg</url>
            <title>Stories by Akash on Medium</title>
            <link>https://medium.com/@akashkumar2602?source=rss-4c2424864d5e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 22:47:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akashkumar2602/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Solving AEP Campaign Activation Challenges Using Data Distiller — Part 4: Scheduling, Tooling &…]]></title>
            <link>https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-4-scheduling-tooling-47399e6664e0?source=rss-4c2424864d5e------2</link>
            <guid isPermaLink="false">https://medium.com/p/47399e6664e0</guid>
            <category><![CDATA[marketing-technology]]></category>
            <category><![CDATA[adobe-experience-platform]]></category>
            <category><![CDATA[ajo]]></category>
            <category><![CDATA[data-distiller]]></category>
            <category><![CDATA[campaign-activation]]></category>
            <dc:creator><![CDATA[Akash]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 23:57:33 GMT</pubDate>
            <atom:updated>2026-02-28T00:12:06.344Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving AEP Campaign Activation Challenges Using Data Distiller — Part 4: Scheduling, Tooling &amp; Best Practices</h3><p><em>A practical guide based on real-world implementation experience</em></p><blockquote><strong><em>This is Part 4 of a 4-part series</em></strong><em> — the final instalment. In </em><a href="https://medium.com/@akashkumar2602/ddccb9858f23"><em>Part 3</em></a><em>, we profile-enabled our derived dataset, created custom attributes, and activated them in Audience Builder and AJO. Now we look at how to make all of this production-grade: keeping data fresh automatically, speeding up your development workflow, and avoiding the pitfalls that trip up real implementations.</em></blockquote><h3>The Problem with Manual Execution</h3><p>Up to this point in the series, we’ve been running queries manually — writing SQL, hitting run, checking results. That’s perfectly fine for development and exploration. But in production, you cannot afford to have someone run a SQL query every day to keep your audience data fresh.</p><p>Memberships expire continuously. Customers move from Low to Medium to High priority as the clock ticks down. A derived dataset that was accurate this morning might be meaningfully wrong by this afternoon if you’re relying on manual refreshes.</p><p>This is where <strong>scheduled queries</strong> come in — and it’s one of the most underrated capabilities of Data Distiller.</p><h3>Scheduling Strategy: INSERT vs INSERT OVERWRITE</h3><p>Before you set up a schedule, you need to make a deliberate choice about your execution strategy. Data Distiller gives you two options, and picking the wrong one has real consequences for performance and data quality.</p><h3>Option 1: INSERT — Incremental Processing</h3><pre>INSERT INTO membership_renewal_target_Profile_Enable<br>SELECT <br>    STRUCT(<br>        customerId AS CrmId,<br>        STRUCT(<br>            renewal_priority AS renewal_priority<br>        ) AS custom_attributes<br>    ) AS _tenantnamespace<br>FROM (<br>    SELECT customerId, renewal_priority<br>    FROM (<br>        SELECT<br>            p.customerId,<br>            p.firstName,<br>            p.lastName,<br>            p.email,<br>            e.membershipType,<br>            e.membershipExpiryDate,<br>            CASE <br>                WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 0 AND 3 THEN &#39;High&#39;<br>                WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 4 AND 7 THEN &#39;Medium&#39;<br>                ELSE &#39;Low&#39;<br>            END AS renewal_priority<br>        FROM profile_customers p<br>        INNER JOIN membership_events e<br>        ON p.customerId = e.customerId<br>        WHERE e.membershipExpiryDate BETWEEN CURRENT_DATE <br>            AND DATEADD(DAY, 7, CURRENT_DATE)<br>            AND e.eventType != &#39;cancel&#39;<br>    ) AS subquery<br>);</pre><p>INSERT appends new and changed records to the existing dataset. It does <strong>not</strong> rebuild from scratch. This is incremental processing — only the delta gets processed each run.</p><p><strong>Use INSERT when:</strong> your dataset grows over time with new records, your data volume is large (processing everything every day would be too slow), or you’re tracking historical state and need to preserve previous records.</p><p><strong>Pros:</strong> Faster execution, lower compute cost, scales well with dataset size.</p><p><strong>Cons:</strong> Requires careful deduplication logic if records can be updated (you don’t want old versions of the same customer sitting alongside new ones). Always handle time and duplication explicitly.</p><h3>Option 2: INSERT OVERWRITE — Full Refresh</h3><pre>INSERT OVERWRITE INTO audience_monthly_refresh<br>SELECT<br>    p.customerId,<br>    p.firstName,<br>    p.lastName,<br>    p.email,<br>    e.membershipType,<br>    e.membershipExpiryDate,<br>    CASE <br>        WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 0 AND 3 THEN &#39;High&#39;<br>        WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 4 AND 7 THEN &#39;Medium&#39;<br>        ELSE &#39;Low&#39;<br>    END AS renewal_priority<br>FROM profile_customers p<br>INNER JOIN membership_events e<br>    ON p.customerId = e.customerId<br>WHERE e.membershipExpiryDate BETWEEN CURRENT_DATE <br>  AND DATEADD(DAY, 7, CURRENT_DATE)<br>  AND e.eventType != &#39;cancel&#39;;</pre><p>INSERT OVERWRITE drops the existing data and rebuilds the dataset entirely from scratch on every run. Every scheduled execution produces a completely fresh dataset.</p><p><strong>Use INSERT OVERWRITE when:</strong> the dataset represents a point-in-time snapshot (like “all members expiring this month”), data changes frequently enough that stale records are a real problem, or your dataset is small enough that full rebuilds are fast.</p><p><strong>Pros:</strong> Simpler to reason about — no deduplication needed, no risk of stale data accumulating.</p><p><strong>Cons:</strong> Slower for large datasets. Rebuilding everything every time is expensive. Use this strategically, not as a default.</p><p>For our membership renewal use case, <strong>daily INSERT is the better choice</strong>. Memberships expire and get renewed continuously, new members join, and the dataset isn’t static — but we don’t need to rebuild the entire history every day.</p><h3>Setting Up the Schedule in AEP</h3><p>Once you’ve written and tested your query, saving it as a scheduled template is straightforward:</p><p><strong>Step 1: Save as a template.</strong> In the Query Service UI, after testing your query, click <strong>“Save and close”</strong> and give it a meaningful name — something like membership_renewal_target_Profile_Enable. This creates a reusable template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BXtgBDH2lB68Dnc3Lc3OOg.png" /></figure><p><strong>Step 2: Open the template and add a schedule.</strong> Go to <strong>Queries → Templates</strong>, find your saved query, open it, and click <strong>“Add schedule”</strong> (visible in the top-right panel).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rZYuuHWzi2RtYP7unuw0g.png" /></figure><p><strong>Step 3: Configure the schedule details:</strong></p><ul><li><strong>Frequency</strong>: Daily, weekly, monthly, or custom. For renewal use cases, daily makes sense since memberships expire every day.</li><li><strong>Execution time</strong>: Set this in UTC. This is critically important — AEP schedules run in UTC, so you must align this with your business timezone. If your marketing team needs the audience refreshed before their 9am CET send, you need to schedule the query for around 7am UTC.</li><li><strong>Query Quarantine</strong>: Enable this. The quarantine feature automatically halts a scheduled query after <strong>10 consecutive failures</strong> — saving you from silent failures that let bad data silently accumulate. Without it, a broken query just keeps failing quietly.</li><li><strong>Alerts</strong>: Enable at minimum Query Run Failure and Query Run Delay alerts. In a production environment, you need to know immediately if something breaks. Add Query Run Success too if you want positive confirmation each run completed.</li></ul><p><strong>Step 4: Save the schedule.</strong> Your derived dataset will now refresh automatically on the cadence you defined. Your audience stays fresh. Your journey personalisation stays accurate. No manual intervention needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0jdKdzPqE7YokT3pwDtHg.png" /></figure><h3>DBVisualizer: The Tool That Changes How You Work</h3><p>Here’s something practical that I wish someone had told me earlier in my AEP journey: the Query Service UI, while functional, has real limitations that slow you down during development.</p><p>The biggest one: <strong>the UI only lets you export up to 1,000 rows</strong>. When you’re validating a derived dataset with 50,000 records, that’s not enough. You’re basically forced to write aggregate queries just to validate things you could see directly if you had a proper view of the data.</p><p>This is where a <strong>PostgreSQL connector like DBVisualizer</strong> changes the game entirely.</p><h3>What DBVisualizer Gives You</h3><p>AEP’s Query Service exposes a PostgreSQL-compatible endpoint. Tools like DBVisualizer (or any PostgreSQL clients) can connect directly to your AEP environment and give you:</p><ul><li><strong>Preview and export up to 50,000 rows</strong> — enough to actually validate large datasets properly</li><li><strong>Interactive filter and sort</strong> — instead of exporting to CSV and opening Excel, you can filter and explore data directly in the tool</li><li><strong>Save SQL files locally</strong> — during development, you don’t want to save every in-progress query as an AEP template. Write locally, iterate fast, only create a template when the query is production-ready</li><li><strong>Faster iteration</strong> — write, run, see results, tweak, repeat. All without the overhead of the query service UI limitation.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-LYA9u_weRkoeyhiqKpwHg.png" /></figure><p>The mental model is this: use the <strong>Query Service UI for quick exploration and production template management</strong>. Use a <strong>PostgreSQL connector like DBVisualizer for development, debugging, and data validation</strong>. They serve different purposes.</p><p>check <a href="https://experienceleague.adobe.com/en/docs/experience-platform/query/clients/dbvisulaizer">this</a> documentation on connecting DBVisualizer to AEP’s Query Service. The connection uses your AEP credentials and the Query Service PostgreSQL endpoint.</p><h3>Best Practices From Real Production Experience</h3><p>These come directly from patterns I’ve seen succeed and fail across multiple AEP implementations. Not theory — practice.</p><h3>1. Don’t Replace Audience Builder for Simple Use Cases</h3><p>Data Distiller is powerful, but it comes with complexity and cost. If a marketing team asks for “all customers in Belgium who have logged in at least once in the last 30 days” — build that in Audience Builder. It takes 2 minutes and requires zero SQL.</p><p>Reach for Data Distiller when you genuinely need it:</p><ul><li>Complex aggregation or grouping across multiple datasets</li><li>Advanced SQL logic that Audience Builder can’t express</li><li>Reusable derived attributes that need to live on the profile</li><li>Faster batch activation cycles where the Audience Builder’s evaluation overhead is too slow</li></ul><h3>2. Keep Queries Simple and Purpose-Driven</h3><p>In enterprise AEP environments with large datasets, query performance is a real concern. A few rules that save you pain:</p><ul><li><strong>Filter early</strong> — put your WHERE clause conditions as early as possible. Avoid scanning the full table before filtering.</li><li><strong>Only select the fields you need</strong> — don’t SELECT * on a large table when you need 5 columns.</li><li><strong>Avoid overly complex joins</strong> — each additional join multiplies the data being processed. If you can break a complex query into two simpler ones, consider it.</li></ul><p><em>Remember: you only have around </em><strong><em>5 concurrent Query Service sessions</em></strong><em> depending on your AEP license. If your team is large and multiple people are running queries simultaneously, long-running unoptimised queries will block others.</em></p><h3>3. Handle Time Explicitly — Always</h3><p>This is a mistake I’ve seen repeatedly. AEP stores all timestamps in <strong>UTC</strong>. If you’re filtering by date without accounting for timezone, your audience membership logic will be subtly wrong for users in non-UTC timezones.</p><p>Always:</p><ul><li>Convert time zones explicitly in your queries when business logic requires it</li><li>Set your scheduled query execution time with UTC in mind</li><li>Validate date-filtered results against your expected business timezone</li></ul><h3>4. Understand How AEP Stores Data</h3><p>AEP is not a traditional SQL database. Data is stored in <strong>distributed file storage</strong>, and Query Service runs on <strong>Spark-based processing</strong>. This means:</p><ul><li>Only Adobe-supported SQL and Spark SQL functions will work. If you get an error on a standard SQL function, always check Adobe’s Query Service documentation before spending time debugging</li><li>Data in the Data Lake is stored in append mode — when you update a profile attribute and ingest a new record, the old record is still there. AEP uses merge policies at the profile level to determine which attribute version to surface</li><li>Derived datasets, once created, have a fixed schema — plan your schema carefully before creating it</li></ul><h3>5. Monitor Your Scheduled Queries</h3><p>Once you hand something off to automation, monitoring becomes critical. Keep an eye on:</p><ul><li><strong>Query execution time</strong> — if a query that used to run in 5 minutes starts taking 25, your dataset has probably grown and needs optimisation</li><li><strong>Dataset size growth</strong> — Data Lake storage is not free. If you’re creating derived datasets that accumulate data indefinitely, implement a data retention policy</li><li><strong>Avoid unnecessary high-frequency schedules</strong> — if a daily refresh is sufficient, don’t schedule hourly. Every scheduled run has a compute cost and uses system resources</li></ul><h3>Key Takeaways: The Real Value of Data Distiller</h3><p>Let me close this series with the takeaways that I think matter most — the things I’d want someone to walk away with after sitting through that February webinar.</p><p><strong>Query Service is for analysis and exploration in the Data Lake — not profile storage.</strong> Understand where your data lives before writing a single line of SQL. This distinction prevents a huge class of confusion.</p><p><strong>Data Distiller extends Query Service from ad-hoc SQL to production-grade data engineering.</strong> CTAS, ITAS, scheduling, incremental processing — these are the capabilities that move you from exploration to activation.</p><p><strong>Derived datasets transform raw event data into activation-ready business intelligence.</strong> The CASE statement that turns an expiry date into “High/Medium/Low” sounds simple. The impact — on audience precision, personalisation relevance, and campaign performance.</p><p><strong>Profile-enabling a derived dataset makes custom attributes part of the Unified Customer Profile.</strong> Once you do this, those attributes are reusable across audiences, journeys, and personalisation — everywhere in AEP, forever.</p><p><strong>Scheduling is what takes it from a demo to a production system.</strong> Choose your strategy (INSERT vs INSERT OVERWRITE) deliberately, set your timezone correctly, enable quarantine and alerts, and stop running SQL manually.</p><p><strong>Use Data Distiller strategically — not for simple segmentation, but for complex logic, enrichment, and reusable attributes.</strong> Audience Builder is still the right tool for simple use cases. Don’t add complexity where it isn’t needed.</p><p>And finally, the thing that I keep coming back to: <strong>we’re not just building audiences. We’re engineering reusable customer intelligence inside AEP.</strong> The derived attribute you build today for a membership renewal campaign can be reused by the personalisation team, the analytics team, and the next campaign — without anyone writing SQL again.</p><h3>Thanks for Following Along</h3><p>This series was based on the real-world use case, the SQL, the patterns — all of it came from actual implementations.</p><p>If you found this series useful, share it with your AEP team. And if you’re dealing with a specific Data Distiller challenge that this series didn’t cover — drop it in the comments. I’m already planning the next series, and your questions directly shape what I write next.</p><p>Let’s connect on <a href="https://www.linkedin.com/in/akash-saw">LinkedIn</a></p><p><em>Previous parts in this series:</em></p><ul><li><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-1-understanding-the-733eb998ef9b"><em>Part 1: Understanding the Foundation — Query Service &amp; Why Data Distiller?</em></a></li><li><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-2-building-your-first-d0d57ebc4c6f"><em>Part 2: Building Your First Derived Dataset with CTAS</em></a></li><li><a href="https://medium.com/@akashkumar2602/ddccb9858f23"><em>Part 3: Custom Attributes, Profile-Enabled Datasets &amp; Batch Audiences</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47399e6664e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving AEP Campaign Activation Challenges Using Data Distiller — Part 3: Custom Attributes…]]></title>
            <link>https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-3-custom-attributes-ddccb9858f23?source=rss-4c2424864d5e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddccb9858f23</guid>
            <category><![CDATA[audience]]></category>
            <category><![CDATA[adobe-experience-platform]]></category>
            <category><![CDATA[data-distiller]]></category>
            <category><![CDATA[adobe-real-time-cdp]]></category>
            <category><![CDATA[adobe-journey-optimizer]]></category>
            <dc:creator><![CDATA[Akash]]></dc:creator>
            <pubDate>Fri, 27 Feb 2026 23:52:46 GMT</pubDate>
            <atom:updated>2026-02-28T00:13:15.467Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving AEP Campaign Activation Challenges Using Data Distiller — Part 3: Custom Attributes, Profile-Enabled Datasets &amp; Batch Audiences</h3><p><em>A practical guide based on real-world implementation experience</em></p><blockquote><strong><em>This is Part 3 of a 4-part series.</em></strong><em> In </em><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-2-building-your-first-d0d57ebc4c6f"><em>Part 2</em></a><em>, we built our first derived dataset using CTAS — joining profile and event data to create a business-ready </em><em>membership_renewal_target dataset with a custom </em><em>renewal_priority attribute. Now we take it to the next level: making that attribute part of the Unified Customer Profile, and using it to build a batch audience you can activate in a journey.</em></blockquote><h3>Why Profile-Enabling Matters</h3><p>At the end of Part 2, we had a clean derived dataset sitting in the Data Lake. The data was correct, validated, and business-ready. But it was isolated. It couldn’t power real-time segmentation. It wasn’t accessible in AJO’s personalisation editor. It wasn’t merged with the customer’s broader profile.</p><p>To unlock all of that, we need to <strong>profile-enable</strong> the derived dataset.</p><p>Here’s what happens when you do:</p><ul><li>The custom attribute (renewal_priority) becomes part of the <strong>Unified Customer Profile</strong></li><li>It’s available directly in the <strong>Audience Builder UI</strong> — no need to re-query raw event data</li><li>It can be used in <strong>AJO journey personalisation</strong> via the profile attributes panel</li><li>It’s merged with every other profile fragment across all your data sources</li><li>It becomes accessible for <strong>real-time segmentation</strong> across all profile-based use cases</li></ul><p>The key thing to understand: if you don’t profile-enable the dataset, your derived data stays in the Data Lake only. It can be queried, but it can’t power anything downstream in the way AEP is designed to work.</p><h3>One Critical Rule — Decide Before You Create</h3><p>Profile-enabling is a <strong>one-time, irreversible decision made at dataset creation time</strong>. You cannot take an existing derived dataset and enable it for profile after the fact.</p><p>This means you must make the architectural decision upfront: does this derived dataset need to be part of the Unified Customer Profile or not? If yes, you build it as profile-enabled from the start. Get this wrong and you’ll need to start over with a new dataset.</p><h3>Step 1: Creating the Profile-Enabled Derived Dataset</h3><p>Creating a profile-enabled derived dataset is a two-step process in Data Distiller: first you define the table structure with CREATE TABLE (which creates the schema and the empty profile-enabled dataset), then you populate it with INSERT INTO.</p><h3>Step 1.a: CREATE TABLE — Define the Structure</h3><p>The CREATE TABLE statement for a profile-enabled dataset looks different from the CTAS we used in Part 2. It uses the WITH (LABEL = &#39;PROFILE&#39;) clause and requires you to explicitly define your primary identity and custom attribute structure.</p><p>Here’s the pattern :</p><pre>CREATE TABLE membership_renewal_target_Profile_Enable (<br>    CrmId TEXT PRIMARY IDENTITY NAMESPACE &#39;crm_id&#39;,<br>    custom_attributes ROW (<br>        renewal_priority STRING<br>    )<br>)<br>WITH (LABEL = &#39;PROFILE&#39;);</pre><p>Breaking this down:</p><p><strong>CrmId TEXT PRIMARY IDENTITY NAMESPACE &#39;crm_id&#39;</strong> — This defines CrmId as the primary identity field, linked to the crm_id identity namespace. This is non-negotiable. Without a defined primary identity, AEP cannot stitch this data with the existing Unified Customer Profile. It has no way of knowing which customer this record belongs to.</p><p><strong>custom_attributes ROW (renewal_priority STRING)</strong> — This creates a nested custom_attributes object within the schema. I deliberately structured it this way to keep all my custom-derived fields organised under one namespace in the profile schema. This makes it easy to find and reference them later in Audience Builder and the AJO personalisation editor.</p><p><strong>WITH (LABEL = &#39;PROFILE&#39;)</strong> — This is the magic line. This single label is what tells AEP to make this dataset part of the Union Profile Schema. Without it, it&#39;s just a regular Data Lake table.</p><p>When you run this statement successfully, AEP returns a <strong>Created Table Dataset ID</strong> — your confirmation that the schema has been created and the dataset is ready to receive data.</p><p>You can then go to <strong>AEP → Datasets → Browse</strong>, search for membership_renewal_target_Profile_Enable, and confirm that it shows <strong>&quot;Profile enabled: Yes&quot;</strong> in the dataset details panel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sGoymGYeveo2CoshEVkOxg.png" /></figure><h3>Step 1.b: INSERT INTO — Populate the Profile-Enabled Dataset</h3><p>Now we insert data into the profile-enabled table using our business logic query:</p><pre>INSERT INTO membership_renewal_target_Profile_Enable<br>SELECT <br>    STRUCT(<br>        customerId AS CrmId,<br>        STRUCT(<br>            renewal_priority AS renewal_priority<br>        ) AS custom_attributes<br>    ) AS _tenantnamespace<br>FROM (<br>    SELECT<br>        customerId, renewal_priority<br>    FROM (<br>        SELECT<br>            p.customerId,<br>            p.firstName,<br>            p.lastName,<br>            p.email,<br>            e.membershipType,<br>            e.membershipExpiryDate,<br>            CASE <br>                WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 0 AND 3 THEN &#39;High&#39;<br>                WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 4 AND 7 THEN &#39;Medium&#39;<br>                ELSE &#39;Low&#39;<br>            END AS renewal_priority<br>        FROM profile_customers p<br>        INNER JOIN membership_events e<br>        ON p.customerId = e.customerId<br>        WHERE e.membershipExpiryDate BETWEEN CURRENT_DATE <br>            AND DATEADD(DAY, 7, CURRENT_DATE)<br>            AND e.eventType != &#39;cancel&#39;<br>    ) AS subquery<br>);</pre><p>This looks more complex than the CTAS in Part 2, and it is — but the reason is important.</p><p><strong>Why STRUCT?</strong> The profile-enabled schema we created has a nested structure — CrmId at the top level, and custom_attributes.renewal_priority nested below it. To insert data into a nested schema, you have to use STRUCT() to mirror that shape. The STRUCT wrapper maps your query output to the exact schema structure AEP expects.</p><p><strong>AS _tenantnamespace</strong> — this is the tenant namespace, which is organisation-specific in AEP. Your namespace will be different — it&#39;s the identifier for your AEP organisation&#39;s custom field group.</p><p>The core business logic — the JOIN, the WHERE filter, and the CASE statement — is identical to what we built in Part 2. The only difference is how we structure the SELECT output to match the profile-enabled schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oWQKH0LzWg_631yvg6NRyQ.png" /></figure><h3>Step 2: Validate the Profile-Enabled Dataset</h3><p>Once the INSERT runs successfully, validate it the same way we did in Part 2 — go to Datasets → Browse, search for membership_renewal_target_Profile_Enable, and check:</p><ul><li>The dataset is showing as <strong>Profile enabled: Yes</strong></li><li>Records are ingested (check the batch activity tab)</li><li>Preview data looks correct — renewal_priority values are what you expect</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fD6ZthnJZZHKOTrs-wOQlQ.png" /></figure><p>Then go one step further: navigate to <strong>AEP → Profiles → Union Schema</strong>. Select the <strong>XDM Individual Profile</strong> class. Search for your custom attribute path — you should find custom_attributes → renewal_priority listed under your tenant namespace as a String field. This confirms the attribute is now part of the Unified Customer Profile and ready to be used everywhere.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRZcMPwi-GMNbpGuNAHf0Q.png" /></figure><h3>Two Ways to Use the Derived Attribute for Audiences</h3><p>Now that renewal_priority is part of the Unified Customer Profile, you have two powerful activation paths.</p><h3>Path A: Audience Builder UI (Recommended for Standard Cases)</h3><p>Because renewal_priority is now a profile attribute, you can use it directly in the Audience Builder — no SQL, no joining, just drag and drop.</p><p>Go to <strong>AEP → Audiences → Create audience → Build rule</strong>. In the Attributes panel, navigate through:</p><pre>Profile Attribute -&gt; _tenantnamespace -&gt; Custom Attributes → renewal_priority</pre><p>Drag it into the rule builder, set the condition to equals, and type High. Save the audience as &quot;Gym Renewal High Priority Audience&quot;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z7QPAm__XJG6MUteA6uaCQ.png" /></figure><p>That’s it. No query. No joining. No complexity. The SQL you wrote once is now powering a reusable profile attribute that any team member can use in the Audience Builder without touching a line of code.</p><p>This is the real value of profile-enabling a derived dataset — you do the complex work once in SQL, and the result becomes a first-class AEP attribute available to everyone.</p><h3>Path B: Create the Audience Directly from SQL (Data Distiller Audience)</h3><p>For cases where the targeting logic is too complex for the Audience Builder UI — or when you want to include specific attributes directly in the audience payload for downstream activation — you can create a batch audience directly using SQL in Data Distiller:</p><pre>CREATE Audience Gym_Renewal_Audience<br>WITH (<br>    primary_identity=customerId,<br>    identity_namespace=crm_id<br>) AS (<br>    SELECT<br>        customerId,<br>        firstName,<br>        lastName,<br>        email,<br>        membershipType,<br>        membershipExpiryDate,<br>        renewal_priority<br>    FROM membership_renewal_target<br>);</pre><p>When you run this, AEP creates a batch audience called gym_renewal_audience directly from your derived dataset. You can find it immediately in <strong>Audiences → Browse</strong>, where you&#39;ll see:</p><ul><li><strong>Origin: Data Distiller</strong> — confirming it was created via SQL</li><li><strong>Dataset used</strong>: gym_renewal_audience</li><li><strong>Records ingested</strong>: your audience size</li><li><strong>Status</strong>: Processing → Published</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MCaYuoWlFj3xIcnI8RM_kQ.png" /></figure><p>This audience includes all the customer attributes you selected — not just the profile identifiers. That means when you use it in an AJO journey, you have direct access to firstName, membershipExpiryDate, and renewal_priority as audience enrichment attributes, ready to use in personalised messages.</p><h3>Activating in AJO: The End-to-End Story</h3><p>Here’s how it all comes together in Adobe Journey Optimizer.</p><p>Add a <strong>Read Audience</strong> node to your journey canvas and select Gym_Renewal_Audience (if using the Data Distiller audience) or create a journey triggered by Gym Renewal High Priority Audience (if using the profile-enabled Audience Builder path).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cFSwzFEBxKbj7zGGuro_5A.png" /><figcaption>using the Data Distiller audience</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Vod75npuLtJQldDiBxlRA.png" /><figcaption>using the profile-enabled Audience Builder</figcaption></figure><p>In your email action, open the personalisation editor. You’ll find your derived attributes in two locations depending on which path you took:</p><ul><li><strong>Data Distiller audience path</strong>: look under <strong>Profile attributes → _tenantnamespace</strong> <strong>→ audienceEnrichment → DDA (Data Distiller Audience) → your audience schema</strong> — all your audience attributes are available here.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1aWXsSFmWA7WZ4sCgn9mUQ.png" /><figcaption>Using Data Distiller Audience attributes</figcaption></figure><ul><li><strong>Profile-enabled path</strong>: look under <strong>Profile attributes → _tenantnamespace → custom_attributes → renewal_priority</strong> — directly on the profile.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mY-w9JGttjAOR1TNxvNC0A.png" /><figcaption>Using Profile-enabled attribute</figcaption></figure><p>Either way, you can build a message like:</p><blockquote>“Hi {{firstName}}, your gym membership expires soon. As a {{renewal_priority}} priority member, we want to make sure you don’t miss out…”</blockquote><p>The personalisation is dynamic, data-driven, and powered by the business logic you baked into the SQL.</p><h3>Wrapping Up Part 3</h3><p>Let’s recap the full journey so far:</p><p>In <a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-2-building-your-first-d0d57ebc4c6f">Part 2</a>, we joined two datasets and created a clean derived dataset (membership_renewal_target) using CTAS, with a business-meaningful renewal_priority custom attribute built from a CASE statement.</p><p>In Part 3, we took that further by creating a <strong>profile-enabled version</strong> of that derived dataset — using ITAS with a STRUCT to match the nested schema. We then used that attribute in two ways: directly in the Audience Builder UI (simple, reusable, no SQL needed after setup), and as a batch audience created directly from SQL (giving full control over complex targeting and attribute payload for downstream activation).</p><p>The data engineering is done once. The business value is reusable everywhere.</p><h3>What’s Coming in Part 4</h3><p>The last part of this series brings it all together operationally. We’ve built and activated the data — but in production, we need it to stay fresh automatically. <a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-4-scheduling-tooling-47399e6664e0">Part 4</a> covers:</p><ul><li><strong>Scheduling strategies</strong>: when to use INSERT (incremental) vs INSERT OVERWRITE (full refresh), and why this choice matters</li><li><strong>DBVisualizer</strong>: how to use a PostgreSQL connector to dramatically speed up your query development and validation workflow</li><li><strong>Best practices</strong> from real production experience — what to watch out for, what to avoid, and how to keep your Data Distiller implementation healthy at scale</li></ul><p><em>Follow me on Medium to catch Part 4 when it’s live. If this series is useful for your work, share it with your AEP team.</em></p><p>Let’s connect on <a href="https://www.linkedin.com/in/akash-saw">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddccb9858f23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving AEP Campaign Activation Challenges Using Data Distiller — Part 2: Building Your First…]]></title>
            <link>https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-2-building-your-first-d0d57ebc4c6f?source=rss-4c2424864d5e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0d57ebc4c6f</guid>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[cta]]></category>
            <category><![CDATA[adobe-journey-optimizer]]></category>
            <category><![CDATA[adobe-experience-platform]]></category>
            <category><![CDATA[data-distiller]]></category>
            <dc:creator><![CDATA[Akash]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 16:02:22 GMT</pubDate>
            <atom:updated>2026-02-28T00:13:46.250Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving AEP Campaign Activation Challenges Using Data Distiller — Part 2: Building Your First Derived Dataset with CTAS</h3><p><em>A practical guide based on real-world implementation experience</em></p><blockquote><strong><em>This is Part 2 of a 4-part series.</em></strong><em> In </em><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-1-understanding-the-733eb998ef9b"><em>Part 1</em></a><em>, we covered the fundamentals — what Query Service is, why the Data Lake vs Profile Storage distinction matters, and what Data Distiller unlocks. Now we get hands-on. In this part, we build a real derived dataset from scratch using a membership renewal use case.</em></blockquote><h3>The Use Case: A Gym Owner’s Problem</h3><p>Let me set the scene with something real and relatable — because in my experience, the best way to understand a technical capability is through a concrete business problem.</p><p>A gym owner wants to send personalised renewal reminder emails to members whose subscriptions are about to expire. Simple enough on the surface. But here’s where it gets interesting:</p><ul><li>The <strong>profile data</strong> (name, email, customer ID) lives in one dataset.</li><li>The <strong>membership event data</strong> (membership type, expiry date, event type) lives in another.</li><li>The marketing team needs not just the raw data, but a <strong>business decision</strong>: is this a High, Medium, or Low priority renewal customer?</li></ul><p>They can’t get that from the Audience Builder alone. The logic is too complex, it spans multiple datasets, and they need this attribute to be reusable — in audiences, in journey personalisation, in campaign messaging.</p><h3>The Source Datasets</h3><p>For this use case, we work with two datasets:</p><p><strong>profile_customers</strong> — the CRM profile data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*VukxxlIxnb8Xp4DLwdpJWw.png" /></figure><p><strong>membership_events</strong> — the membership event data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*k54wSShzvHSb4iul1fs9TA.png" /></figure><p>These two datasets are independently useful — but neither alone gives the marketing team what they need. We need to join them, apply business logic, and create something new.</p><h3>Step 1: Building the Derived Dataset with CTAS</h3><p>CTAS — <strong>Create Table As Select</strong> — is the core Data Distiller command for creating a new derived dataset from a SQL query. Think of it like saving the result of a SQL query as a brand new, permanent dataset in AEP’s Data Lake.</p><p>Here’s the SQL we use to create our membership renewal derived dataset:</p><pre>CREATE TABLE membership_renewal_target AS<br>SELECT<br>    p.customerId,<br>    p.firstName,<br>    p.lastName,<br>    p.email,<br>    e.membershipType,<br>    e.membershipExpiryDate,<br>    CASE <br>        WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 0 AND 3 THEN &#39;High&#39;<br>        WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 4 AND 7 THEN &#39;Medium&#39;<br>        ELSE &#39;Low&#39;<br>    END AS renewal_priority<br>FROM profile_customers p<br>INNER JOIN membership_events e<br>    ON p.customerId = e.customerId<br>WHERE e.membershipExpiryDate BETWEEN CURRENT_DATE <br>  AND DATEADD(DAY, 7, CURRENT_DATE)<br>  AND e.eventType != &#39;cancel&#39;;</pre><p>Let’s walk through what this query is doing — because every part of it is intentional.</p><h3>The JOIN</h3><pre>FROM profile_customers p<br>INNER JOIN membership_events e<br>    ON p.customerId = e.customerId</pre><p>We join the profile and event datasets on customerId. This is how we combine profile attributes (name, email) with event attributes (membership type, expiry date) into a single flat record.</p><h3>The WHERE Clause</h3><pre>WHERE e.membershipExpiryDate BETWEEN CURRENT_DATE <br>  AND DATEADD(DAY, 7, CURRENT_DATE)<br>  AND e.eventType != &#39;cancel&#39;</pre><p>We’re filtering to only include members whose membership expires within the next 7 days — and explicitly excluding cancelled memberships. In a production environment with large datasets, <strong>filtering early with WHERE is critical for performance</strong>. Never scan what you don’t need.</p><p>One thing to note: AEP’s Query Service runs on Spark-based processing, not a traditional SQL database. It supports Adobe-validated SQL functions. DATEDIFF and DATEADD work here, but always verify any function against <a href="https://experienceleague.adobe.com/en/docs/experience-platform/query/sql/syntax">Adobe&#39;s documentation</a> if you&#39;re unsure — not all standard SQL functions are supported.</p><h3>The CASE Statement — Turning Raw Data Into Business Actionable Data</h3><pre>CASE <br>    WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 0 AND 3 THEN &#39;High&#39;<br>    WHEN DATEDIFF(e.membershipExpiryDate, CURRENT_DATE) BETWEEN 4 AND 7 THEN &#39;Medium&#39;<br>    ELSE &#39;Low&#39;<br>END AS renewal_priority</pre><p>This is the business logic layer. Instead of giving the marketing team a raw expiry date and asking them to figure out urgency, we bake the decision directly into the data:</p><ul><li><strong>0–3 days to expiry</strong> → High priority</li><li><strong>4–7 days to expiry</strong> → Medium priority</li><li><strong>Beyond 7 days</strong> → Low (though our WHERE clause means only 0–7 day records are included anyway)</li></ul><p>This renewal_priority field is no longer a temporary calculation. Once this query runs, it becomes a <strong>physical field</strong> in the derived dataset — a stored, reusable attribute, not a dynamic formula that needs to be recomputed every time.</p><h3>What Happens When You Run This Query</h3><p>When you execute this CTAS query in the AEP Query Service UI, two things happen automatically:</p><p><strong>1. A new dataset is created</strong> — membership_renewal_target — visible in your AEP Data Lake under Datasets → Browse. You&#39;ll see the record count, preview rows, and ingestion status.</p><p><strong>2. AEP auto-generates a schema</strong> — When you create a derived dataset via CTAS, AEP automatically generates a schema based on the columns and data types in your SELECT. This schema will reflect all your fields: customerId, firstName, lastName, email, membershipType, membershipExpiryDate, and renewal_priority.</p><p>This auto-generated schema is important. Before you use this dataset for activation, <strong>review it carefully</strong> — check the field names, data types, and structural alignment. Once you profile-enable a dataset, the schema is fixed. More on that in Part 3.</p><h3>Step 2: Validating the Derived Dataset</h3><p>A derived dataset is only useful if the data in it is correct. This validation step is not optional — in production environments, I’ve seen issues caught here that would have silently corrupted downstream audiences, Journey and Personalisation.</p><p>After running the CTAS query, go to <strong>AEP → Datasets → Browse</strong> and search for membership_renewal_target. You&#39;ll see:</p><ul><li><strong>Record count</strong> — does this match your expectations? If you expected ~500 members expiring in the next 7 days and you see 50,000, something’s wrong with your filter.</li><li><strong>Preview data</strong> — spot check a few rows. Is renewal_priority assigned correctly? Is membershipExpiryDate in the right range?</li><li><strong>Schema</strong> — confirm all fields are present with the right data types. AEP generates this automatically, but review it before proceeding.</li><li><strong>Cancelled memberships</strong> — explicitly verify that records with eventType = &#39;cancel&#39; are NOT in the dataset. This is easy to confirm with a quick SELECT against the derived table.</li></ul><p>One more important thing to check in the dataset view: you’ll notice it says <strong>“Not enabled for profile”</strong> and <strong>“Not enabled for lookup”</strong>. This is expected at this stage — we’ve built the derived dataset in the Data Lake, but it hasn’t been wired into the Unified Customer Profile yet.</p><p>That’s where Part 3 picks up.</p><h3>What We’ve Built So Far</h3><p>Let’s step back and appreciate what we’ve actually accomplished with this single CTAS query.</p><p>We started with two separate, raw datasets that the marketing team couldn’t work with directly. We joined them, applied business logic, and created a new dataset — membership_renewal_target — that contains:</p><ul><li>Full profile details (name, email)</li><li>Membership context (type, expiry date)</li><li>A business decision field (renewal_priority) that classifies each customer as High, Medium, or Low</li></ul><p>This is <strong>activation-ready data</strong>. Not raw events. Not profile fragments. A clean, structured, business-meaningful record for every customer whose membership is about to expire.</p><p>But we’re not done yet. Right now this dataset lives only in the Data Lake. The real power comes when we take this data and make it part of the Unified Customer Profile — so it can be used in Audience Builder, in AJO journey personalisation, and across every downstream system. That’s exactly what Part 3 covers.</p><h3>What’s Coming in Part 3</h3><p>In <a href="https://medium.com/@akashkumar2602/ddccb9858f23">Part 3</a>, we go deeper. We’ll take this derived dataset and do two powerful things with it:</p><ol><li><strong>Create a profile-enabled derived dataset</strong> using ITAS — making renewal_priority a real custom attribute on the Unified Customer Profile, available everywhere in AEP.</li><li><strong>Create a batch audience directly from derived data</strong> using SQL — giving you full control over complex targeting logic that the Audience Builder UI can’t handle.</li></ol><p>We’ll walk through the full SQL, the AEP UI steps for profile-enabling, and how to use the derived attribute in Audience Builder and AJO personalisation.</p><p><em>Follow me on Medium to get notified when Part 3 drops. Questions about the CTAS query or the use case? Drop them in the comments.</em></p><p>Let’s connect on <a href="https://www.linkedin.com/in/akash-saw">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0d57ebc4c6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving AEP Campaign Activation Challenges Using Data Distiller — Part 1: Understanding the…]]></title>
            <link>https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-1-understanding-the-733eb998ef9b?source=rss-4c2424864d5e------2</link>
            <guid isPermaLink="false">https://medium.com/p/733eb998ef9b</guid>
            <category><![CDATA[adobe-experience-platform]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[query-service]]></category>
            <category><![CDATA[data-distiller]]></category>
            <category><![CDATA[adobe-journey-optimizer]]></category>
            <dc:creator><![CDATA[Akash]]></dc:creator>
            <pubDate>Tue, 24 Feb 2026 15:59:53 GMT</pubDate>
            <atom:updated>2026-02-28T00:14:13.589Z</atom:updated>
            <content:encoded><![CDATA[<h3>Solving AEP Campaign Activation Challenges Using Data Distiller — Part 1: Understanding the Foundation</h3><p><em>A practical guide based on real-world implementation experience</em></p><blockquote><strong><em>This is Part 1 of a 4-part series</em></strong><em> based on a live webinar I co-presented in February 2026 on solving real AEP campaign activation challenges using Data Distiller. If you’ve ever struggled with complex batch audiences, heavy SQL joins, or rebuilding segments again and again — this series is for you.</em></blockquote><h3>A Bit About Me</h3><p>I’m Akash, a Senior AEP Consultant at Capgemini Belgium. I work at the intersection of data engineering and marketing activation — helping businesses translate complex use cases into activation-ready datasets, optimise Query Service performance, and build scalable audience pipelines inside Adobe Experience Platform.</p><p>Over the past few years, I’ve seen the same challenges come up across different clients and industries: marketing teams waiting too long for audiences, engineers writing the same SQL logic repeatedly, and everyone wondering — <em>should we use the Audience Builder, or is there something better for this use case?</em></p><p>That’s exactly what this series is about.</p><h3>Why This Series?</h3><p>In February 2026, I co-presented a webinar titled <strong>“Solving AEP Campaign Activation Challenges Using Data Distiller”</strong> alongside Parvesh Parmar, Principal Consultant at Vedhanix Consulting, Belgium. The session was packed with real use cases, live demos, and hard-won lessons from production environments.</p><p>The response was great, so I decided to write it all down — so you can follow along at your own pace, revisit the concepts, and go deeper wherever you need to.</p><p>Here’s what we’ll cover across the four parts:</p><ul><li><strong>Part 1 (this post):</strong> Query Service fundamentals — understanding where your data actually lives, and why that matters. Plus, the big question: <em>Why Data Distiller?</em></li><li><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-2-building-your-first-d0d57ebc4c6f"><strong>Part 2</strong></a><strong>:</strong> Building your first derived dataset with CTAS — from raw data to something your marketing team can actually use.</li><li><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-3-custom-attributes-ddccb9858f23"><strong>Part 3</strong></a><strong>:</strong> Advanced batch targeting, custom attributes, profile-enabling datasets, and creating audiences with SQL.</li><li><a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-4-scheduling-tooling-47399e6664e0"><strong>Part 4</strong></a><strong>:</strong> Scheduling strategies, DBVisualizer for productivity, best practices, and key takeaways.</li></ul><p>Let’s start with the foundation.</p><h3>Part 1: Query Service — What It Is and Where the Data Actually Lives</h3><p>Before we can understand Data Distiller, we need to be crystal clear on Query Service, because a lot of confusion in the real world comes from one simple misunderstanding.</p><h3>The Most Important Thing Nobody Tells You About Query Service</h3><p>When you run a query in AEP’s Query Service UI, <strong>you are only reading data stored in the Data Lake — not Profile Storage.</strong></p><p>This sounds obvious, but it trips up a lot of people. AEP has two very different storage layers:</p><ul><li><strong>Data Lake</strong> — where all your raw ingested event data, batch files, and streaming data lands. This is what Query Service reads from.</li><li><strong>Profile Storage (Cosmos DB)</strong> — where the Unified Customer Profiles live. Query Service cannot access this directly.</li></ul><p>Why does this matter? Because if you’re trying to validate whether a customer’s profile attribute was updated correctly, running a query in Query Service will not show you the current state of that profile. You’d be looking at the raw data in the lake, not the computed profile.</p><p>This distinction is critical when making architecture decisions — especially around where to build your logic.</p><h3>How Data Gets Into the Data Lake</h3><p>AEP Primarily supports two ingestion patterns, and the timing is different for each:</p><ul><li><strong>Streaming API / Web SDK</strong> — data is available in the Data Lake within approximately 15 minutes of ingestion.</li><li><strong>Batch ingestion</strong> — data is available as soon as the data flow run completes.</li></ul><p>Once in the Data Lake, Query Service kicks in as your analysis engine.</p><h3>What Query Service Is Actually Used For (Day-to-Day Reality)</h3><p>In real projects, Query Service is incredibly useful for three things:</p><p><strong>1. Validating data ingestion.</strong> After a batch load or a new streaming integration, the first thing I do is check: Did the records land? Is the count correct? Are the field types what I expect? A quick SELECT with a LIMIT tells you a lot quickly.</p><pre>SELECT _spnam.PX_Nova_CRM_ID, _spnam.PX_Nova_Email<br>FROM px_nova_crm_customer_profile_schema_01<br>LIMIT 4;</pre><p>Notice the LIMIT — this is not just for convenience. On large tables, scanning without a limit can take time and consume one of your concurrent query sessions (AEP typically allows limited concurrent sessions depending on your license). Always be deliberate.</p><p><strong>2. Quick data analysis before building audiences.</strong> Batch audiences evaluate once a day. If the marketing team asks “how many customers have a membership expiring in the next 7 days?”, you don’t want to wait for an audience to evaluate just to get a number. Query Service lets you run an aggregate query right now and give them a count.</p><p><strong>3. Analysing journey data.</strong> When an Adobe Journey Optimizer journey is running, the activity data flows between steps and gets stored in datasets. Query Service lets you inspect this data to understand how records are flowing through the journey — great for debugging and optimisation.</p><p>Follow this link for Query Service Guardrails Documentation — <a href="https://experienceleague.adobe.com/en/docs/experience-platform/query/guardrails">https://experienceleague.adobe.com/en/docs/experience-platform/query/guardrails</a></p><h3>The One Limitation That Changes Everything</h3><p>Query Service is powerful, but it has a hard ceiling: <strong>it only supports </strong><strong>SELECT queries.</strong> You can read, filter, join, and aggregate. But you cannot write data. You cannot create new datasets. You cannot schedule recurring runs.</p><p><em>“Without Data Distiller, we can analyse the data, but we cannot operationalise it. We cannot activate it.”</em></p><p>That’s the gap Data Distiller fills.</p><h3>Why Data Distiller?</h3><p>Data Distiller is not a replacement for Query Service — it’s an extension of it. Think of Query Service as your exploration layer, and Data Distiller as your production data engineering layer.</p><p>Here’s the key difference at a glance:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ilkVsIKyqad42CyYWjw5g.png" /></figure><p>Two SQL commands unlock most of the power here: <strong>CTAS</strong> and <strong>ITAS</strong>.</p><ul><li><strong>CTAS (Create Table As Select)</strong> — creates a brand new derived dataset from a SQL query. This is how you go from raw event data to a structured, business-ready dataset.</li><li><strong>ITAS (Insert Table As Select)</strong> — inserts new rows into an existing dataset based on a query. This is how you do incremental updates — only processing new or changed data rather than rebuilding from scratch every time.</li></ul><h3>From Raw Data to Activation-Ready</h3><p>Here’s the mental model that makes everything click:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hDvX8uGQHEa9j3lFuMIeqQ.png" /></figure><p>On the <strong>left</strong>, you have raw data — sales events, web events, CRM records, membership data. Individually, each dataset is useful for analysts, but it’s not ready for marketing activation. It’s too technical, too granular, and often spread across multiple tables.</p><p>In the <strong>middle</strong>, Data Distiller uses SQL to join these datasets, apply business rules, aggregate behaviour, and create flags and priorities. This is your transformation layer.</p><p>On the <strong>right</strong>, you get a <strong>derived dataset</strong> — business-actionable data. Targeted audiences. Custom attributes. Aggregated KPIs. Enriched customer profiles. And when you profile-enable this derived dataset, those attributes become reusable across audiences, journeys, and personalisation — automatically.</p><h3>What’s Coming in Part 2</h3><p>Now that we understand the foundation — where data lives, what Query Service can and can’t do, and why Data Distiller exists — we’re ready to get hands-on.</p><p>In <a href="https://medium.com/@akashkumar2602/solving-aep-campaign-activation-challenges-using-data-distiller-part-2-building-your-first-d0d57ebc4c6f"><strong>Part 2</strong></a>, we’ll walk through building a real derived dataset using CTAS. We’ll use a membership renewal use case (something very common in retail and subscription businesses) to show how you join profile data with event data, apply business logic with a CASE statement, and create a new dataset that your marketing team can actually use.</p><p>We’ll look at the actual SQL, the AEP UI steps, and how to validate that everything landed correctly.</p><p><em>Follow me on Medium to get notified when Part 2 drops. If you have questions or want to share your own Data Distiller experiences, drop them in the comments — I’d love to hear what challenges you’re dealing with in your projects.</em></p><p>Let’s connect on <a href="https://www.linkedin.com/in/akash-saw">LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=733eb998ef9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get Audience Name, ID, and Profile Count Using Adobe Experience Platform Query Service]]></title>
            <link>https://medium.com/@akashkumar2602/how-to-get-audience-name-id-and-profile-count-using-adobe-experience-platform-query-service-091bd29a2ce6?source=rss-4c2424864d5e------2</link>
            <guid isPermaLink="false">https://medium.com/p/091bd29a2ce6</guid>
            <category><![CDATA[audience-metadata]]></category>
            <category><![CDATA[query-service]]></category>
            <category><![CDATA[adobe-experience-platform]]></category>
            <category><![CDATA[aep]]></category>
            <category><![CDATA[audience-name]]></category>
            <dc:creator><![CDATA[Akash]]></dc:creator>
            <pubDate>Fri, 20 Feb 2026 17:12:40 GMT</pubDate>
            <atom:updated>2026-02-24T17:51:30.273Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical guide for data analysts and marketers who want quick audience insights</em></p><h3>The Business Problem</h3><p>In Adobe Experience Platform (AEP), business teams often need a consolidated view of their audiences — something that answers questions like:</p><ul><li>What is the <strong>name</strong> of this audience?</li><li>What is its <strong>ID</strong>?</li><li>How many <strong>profiles</strong> are currently in it?</li><li>Which <strong>namespace</strong> does it belong to?</li></ul><p>While this information exists in AEP, it’s spread across two different datasets — the <strong>Segment Definition Snapshot</strong> and the <strong>Profile Snapshot Export</strong>. The good news? You can pull it all together with just a few SQL queries in <strong>AEP Query Service</strong>.</p><p>Let’s walk through it step by step.</p><h3>Step 1 — Understanding Your Data Sources</h3><p>Before writing any query, you need to know which datasets to query. In AEP Query Service, you’ll typically work with two kinds of exported datasets:</p><p><strong>1. Segment Definition Snapshot</strong> — contains the metadata about your audiences (name, ID, identity map). Example table name: segmentdefinition_snapshot_export_aaaaa_bbbbb_cccc_dddd_eeee</p><p><strong>2. Profile Snapshot Export</strong> — contains profile-level data including which segments each profile belongs to. Example table name: profile_snapshot_export__aaaaa_bbbbb_cccc_dddd_eeee</p><blockquote><strong><em>Note:</em></strong><em> Your table names will be different — find them in the </em><strong><em>Datasets</em></strong><em> section of AEP.</em></blockquote><h3>Step 2 — Extract Audience Name and ID from the Segment Definition Snapshot</h3><p>The segment definition snapshot stores identity information in a nested identityMap column. To extract the audience name along with its ID, we need to <strong>explode</strong> the nested map and then drill into the struct to get the actual ID value.</p><h4>Initial Query — Exploding the Identity Map</h4><pre>SELECT AudienceName, source_namespace, val AS segment_id <br>FROM (<br>  SELECT <br>    AudienceName, <br>    UPPER(key) AS source_namespace, <br>    EXPLODE(value) AS val<br>  FROM (<br>    SELECT <br>      segmentName AS AudienceName, <br>      EXPLODE(identityMap)<br>    FROM segmentdefinition_snapshot_export_aaaaa_bbbbb_cccc_dddd_eeee<br>  )<br>)</pre><p>Running this gives us a val column that looks like a struct:</p><pre>(NULL, 7a08a461-444c-4841-bb57-bc968914a07f, NULL)</pre><p>This is a struct with three fields. The <strong>second field</strong> is the actual audience ID we need. In AEP’s identity map, the struct schema is typically (primary, id, namespace) — so we access it using .id.</p><h3>Refined Query — Extracting the ID Field</h3><pre>SELECT<br>  AudienceName,<br>  source_namespace,<br>  val.id AS audience_id<br>FROM (<br>  SELECT<br>    AudienceName,<br>    UPPER(key) AS source_namespace,<br>    EXPLODE(value) AS val<br>  FROM (<br>    SELECT <br>      segmentName AS AudienceName,<br>      EXPLODE(identityMap)<br>    FROM segmentdefinition_snapshot_export_aaaaa_bbbbb_cccc_dddd_eeee<br>  )<br>)</pre><p><strong>Sample Output:</strong></p><blockquote>AudienceName | source_namespace | audience_id</blockquote><blockquote>Test1 | UPS | 7a08a461–444c-4841-bb57-bc968914a07f</blockquote><blockquote>Test2 | DDA | e99891cb-2a17–4b40–9161–68a06cd2d6b3</blockquote><p>Now we have a clean mapping of <strong>Audience Name → Audience ID → Namespace</strong>.</p><h3>Step 3 — Count Profiles Per Audience from the Profile Snapshot</h3><p>The profile snapshot export contains a segmentMembership column, which is also a nested map. We explode it and group by audience ID to get the profile count.</p><pre>SELECT<br>  key AS audience_id,<br>  MAX(Origin) AS source_namespace,<br>  COUNT(1) AS count_of_profiles<br>FROM (<br>  SELECT<br>    UPPER(key) AS source_namespace,<br>    EXPLODE(value)<br>  FROM (<br>    SELECT<br>      EXPLODE(segmentMembership)<br>    FROM profile_snapshot_export_aaaaa_bbbbb_cccc_dddd_eeee<br>  )<br>)<br>GROUP BY audience_id</pre><p><strong>Sample Output:</strong></p><blockquote>audience_id | source_namespace | count_of_profiles</blockquote><blockquote>0330548b-3726–40fc-b10c-bfe4d1b9a4a2 | UPS | 39057</blockquote><blockquote>adccc-1a8f-401e-8976-f9fa69b27037 | UPS | 9997105</blockquote><p>We now have <strong>Audience ID → Profile Count</strong>.</p><h4>Step 4 — Join Everything Together</h4><p>Now comes the final step — joining the two results on audience_id to get a single, clean table with audience name, ID, namespace, and profile count.</p><pre>SELECT<br>  p.audience_id,<br>  s.AudienceName,<br>  p.source_namespace,<br>  p.count_of_profiles<br>FROM<br>(<br>  -- Profile counts per audience<br>  SELECT<br>    key AS audience_id,<br>    MAX(source_namespace) AS source_namespace,<br>    COUNT(1) AS count_of_profiles<br>  FROM (<br>    SELECT<br>      UPPER(key) AS source_namespace,<br>      EXPLODE(value)<br>    FROM (<br>      SELECT<br>        EXPLODE(segmentMembership)<br>      FROM<br>        profile_snapshot_export_aaaaa_bbbbb_cccc_dddd_eeee<br>    )<br>  )<br>  GROUP BY audience_id<br>) p<br>LEFT JOIN<br>(<br>  -- Audience name lookup<br>  SELECT<br>    AudienceName,<br>    source_namespace,<br>    val.id AS audience_id<br>  FROM (<br>    SELECT<br>      AudienceName,<br>      UPPER(key) AS source_namespace,<br>      EXPLODE(value) AS val<br>    FROM (<br>      SELECT<br>        segmentName AS AudienceName,<br>        EXPLODE(identityMap)<br>      FROM<br>        segmentdefinition_snapshot_export_aaaaa_bbbbb_cccc_dddd_eeee<br>    )<br>  )<br>) s<br>ON p.audience_id = s.audience_id</pre><p><strong>Final Output:</strong></p><blockquote>audience_id | AudienceName | source_namespace| count_of_profiles</blockquote><blockquote>05e2dea7-… | Test1 | DDA | 19933057</blockquote><blockquote>adccc-… | Test2 | UPS| 9997</blockquote><h3>Why LEFT JOIN and Not INNER JOIN?</h3><p>We use a LEFT JOIN intentionally. This ensures that even if some audience IDs in the profile snapshot <strong>don&#39;t have a matching entry</strong> in the segment definition snapshot (e.g., system-generated or recently deleted audiences), they still appear in the output — just with a NULL for the audience name.</p><p>If you only want audiences that have a matching name, switch to INNER JOIN.</p><h3>Key Takeaways</h3><ul><li>AEP stores audience metadata and profile membership in <strong>separate nested datasets</strong> — you need to explode and join them to get a complete picture.</li><li>The identityMap struct follows the pattern (primary, id, namespace) — always use .id to extract the audience ID.</li><li>Using LEFT JOIN ensures you don&#39;t accidentally lose audiences that may be missing from one of the snapshots.</li><li>This query can be <strong>scheduled</strong> in AEP Query Service to give your business team a refreshed audience report on a regular cadence.</li></ul><h3>Use Cases</h3><p>This pattern is useful whenever your business team asks:</p><ul><li>“How many users are in our re-engagement campaign audience?”</li><li>“Which audiences have fewer than 1000 profiles — can we merge them?”</li><li>“Give me a full list of active audiences with their sizes for the quarterly review.”</li></ul><p>Instead of manually clicking through the AEP UI for each audience, one SQL query gives you the complete picture in seconds.</p><p><em>Have questions or a variation of this use case? Drop a comment below — happy to help you adapt the query for your specific AEP setup.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=091bd29a2ce6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>