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.
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
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)
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
André Arnaud de Cal...
291,969
Super User 2025 Season 1
Martin Dráb
230,842
Most Valuable Professional
nmaenpaa
101,156