Writing query who left a specific audience | Community
Skip to main content
Level 2
February 3, 2026
Question

Writing query who left a specific audience

  • February 3, 2026
  • 2 replies
  • 30 views

Hi,

 

I’m looking for a query to check which profiles left a certain audience (segment status: exited) in a specific timeframe.

I’ve tried via the segment orchestration dataset and the profile snapshot but couldn’t figure out how to do it with both.

 

Many thanks in advance!

 

Best regards,

Rob

    2 replies

    Level 2
    February 4, 2026

    @RobVe2 Currently, it is not possible to determine the exact timeframe when a profile exited a segment in AEP. Segment exit is not stored as a timestamped event on the profile, so historical exit timing cannot be queried via Profile Snapshot Segment Membership.

    Any segment membership that is in the exited status for more than 30 days, based on the lastQualificationTime, will be subject to deletion. 

    After this period there will be no trace left, membership record will be deleted.

    Ref:https://experienceleague.adobe.com/en/docs/experience-platform/xdm/field-groups/profile/segmentation

     

    You can use this query to determine profiles in exited status, provided they have not yet passed the 30 days retention window.

    SELECT
      *
    FROM profile_snapshot_export_XXXXXX
    WHERE segmentMembership['ups']['<segment_id>']['status'] IN ('exited')

    Devyendar
    Level 6
    February 10, 2026

    @RobVe2 easier approach is to create a custom Dataset with our without XDM schema, where you run CTAS query on Profile Snapshot dataset to find all the profiles in a segment long with createData (record in custom Dataset to identify datetime record was created), you can set the schema as Daily/Hourly based on your requirements. Although this might not work for your old Segments this can be an approach to monitor going forward