The views and opinions expressed in this blog are those solely of the author(s) and do not necessarily reflect Microsoft’s current policy, position, or branding. For official announcements and guidance on Dynamics 365 apps and services, please visit the Microsoft Dynamics 365 Blog.
Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
In previous posts about Microsoft Dynamics CRM I have explained how hierarchical relationships operate and how rolled up fields are created. It is possible to combine both of these concepts, something I didn’t explain!
This post will explain how to roll up fields within a hierarchy.
Say each account has a revenue field. And you have a hierarchy of parent and child accounts. In this scenario it might be useful to see a rolled up value of total revenue for the group of accounts. It could also be helpful to see a count of how many children each parent has.
Here I will explain how to create these rolled fields and also comment on what values they would then hold for the parent and child accounts.
Out of the box a hierarchical relationship exists between parent and child accounts. So I will use that for this example. But this logic will also work on custom entities / relationships.
I created two fields. One called “Total Revenue” that would sum the Revenue field. And another call “Count of Branches”. This would could the number of children each account record has. You can see below my total revenue field. This is a currency field that in the field type I have changed the type from Simple to Rollup. Next I clicked edit to set the roll up details.
Having selected edit I created the roll up logic for my new total revenue field. (Shown below.) Notice that I have changed the “Use Hierarchy” setting to Yes and selected a relationship. (Actually only one hierarchical relationship was present was it was defaulted in!) Also notice that I select “Sum of Annual Revenue” as my aggregation. Annual Revenue is an out of the box field on the Account entity but you could obviously also use custom fields if required.
Having created the total revenue field, I created my count of branches. The field was pretty similar to total revenue, except the data type for my count was whole number. I still said it was a Rollup field and continued to click edit to define the detail.
My roll up field details were pretty similar. I selected yes to the hierarchy option and selected the same relationship as before. But this time my aggregation was “Count of Account”.
I then added this fields, with the additional fields created for rollup fields to my form.
Note: The additional fields are when the value was last rolled up and its state. If you don’t understand how these fields operate or would like to know more about when the roll up happens, I suggest you refer to my earlier post on rolling up fields.
All is good. J
But the reason I did this test was to understand what values will be in my total revenue and count of branch fields for the parent and child accounts. Especially when the hierarchy has multiple levels. I had some questions!
The graphic below shows the results I obtained in a multi-level hierarchy.
Hopefully this post has given you an insight into how hierarchical roll up fields operate.
Business Applications communities