
Hi everyone,
We have around 40 different services and each contact can be linked to any number of those and vice versa (related entity).
What I want to do is create a chart where I see service names on the x axis and number of individual contacts linked to those services on the y axis.
This is certainly not complicated but I just cannot get round to this.
Any ideas would be much appreciated.
Thanks!
Hi jrymkiewicz,
You can refer to the following link:
https://crmchartguy.wordpress.com/2014/11/05/nn-relationship-charts-in-ms-dynamics-crm/
I can achieve it successfully:
1.Create one chart:
2. Export and Edit chart xml(Red is the modified part):
Original:
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="new_services">
<attribute name="new_name" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
<attribute name="new_name" aggregate="count" alias="_CRMAutoGen_aggregate_column_Num_0" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category alias="_CRMAutoGen_groupby_column_Num_0">
<measurecollection>
<measure alias="_CRMAutoGen_aggregate_column_Num_0" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
Edit:
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="new_services">
<link-entity name="new_new_services_contact" from="new_servicesid" to="new_servicesid">
<attribute alias="CountOfContacts" name="new_servicesid" aggregate="count" />
</link-entity>
<attribute groupby="true" alias="GroupBy" name="new_servicesid" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category alias="GroupBy">
<measurecollection>
<measure alias="CountOfContacts" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
3.Import it.
4.Result:
===========================
If you don't want to export and import, you can use 'AdvancedChartEditor' xrmtoolbox to edit chart directly.