Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

Segment query consolidated data with SUM

(0) ShareShare
ReportReport
Posted on by 20

Hello! 

I'm trying to get a segment using consolidated data into the query, a typical example would be:

"Get all main contacts from accounts which the sum of all estimated import of related opportunities in a period is more than XX"

How we can achieve this query/result segment on Dynamics Marketing 365? Is it possible? I've read into documentation the use of SUM function but I wasn't able to use it in a proper way.

Thank you for help.

  • Verified answer
    Petit Hibou Profile Picture
    Petit Hibou on at
    RE: Segment query consolidated data with SUM

    Hi Oscar,

    HAVING is exactly about interactions that I've written about. Using SUM with Traverse looks a bit odd for me. I guess, I need to ask my colleagues to review and verify this document.

    A small addition to my previous answer: "hardcoded part" may be resolved by using a custom attribute which can be updated using any means outside of Marketing – e.g. CRM workflows, plugins or some other jobs that would update data in CDS.

    Br

    Elena

  • RE: Segment query consolidated data with SUM

    Thank you, I suppose that into oficial documentation it will be use for TRAVERSE:

    SUM

    An expression that can be called on the result of TRAVERSE or inside HAVING expression, for grouping conditional expression.

    Syntax SUM(propertyName)

    docs.microsoft.com/.../segment-query-definition

  • Verified answer
    Petit Hibou Profile Picture
    Petit Hibou on at
    RE: Segment query consolidated data with SUM

    Hi Oscar,

    it looks like the case you've described is not relevant for using SUM. The segment you want to build is related to a profile based query,while SUM can be used only in interaction queries, as aggregation function.

    Your goal might be achieved on CRM side as a new calculated field on the account entity, summing all opportunities, and simple attribute filter, on segmentation, after. It will be limited however by the fact that extra attribute will have to have hardcoded “period” part of the query.

    HTH

    Elena

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans