If I have a list of appointments w/ status codes I want to create a pie chart of, is there a way to combine some of the status codes to make the chart more readable:
Example: I have status codes A1, A2, A3, A4, B1, B2, B3, B4, C1, C2, C3, C4. Is there a way via FetchXML that I can create groupings of all the A, all the B, and all the C status codes so the pie chart only has 3 sections?
Here is the existing code:
<visualization>
<visualizationid>{F312E947-987E-E111-8116-00155D825C08}</visualizationid>
<name>This Week's Status Codes</name>
<primaryentitytypecode>serviceappointment</primaryentitytypecode>
<datadescription>
<datadefinition>
<fetchcollection>
<fetch mapping="logical" aggregate="true">
<entity name="serviceappointment">
<attribute groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" name="statuscode" />
<attribute alias="_CRMAutoGen_aggregate_column_Num_0" name="statuscode" aggregate="count" />
</entity>
</fetch>
</fetchcollection>
<categorycollection>
<category alias="_CRMAutoGen_groupby_column_Num_0">
<measurecollection>
<measure alias="_CRMAutoGen_aggregate_column_Num_0" />
</measurecollection>
</category>
</categorycollection>
</datadefinition>
</datadescription>
<presentationdescription>
<Chart Palette="None" PaletteCustomColors="55,118,193; 197,56,52; 149,189,66; 117,82,160; 49,171,204; 255,136,35; 97,142,206; 209,98,96; 168,203,104; 142,116,178; 93,186,215; 255,155,83">
<Series>
<Series ShadowOffset="0" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PieLabelStyle=Inside, PieDrawingStyle=Default" ChartType="pie">
<SmartLabelStyle Enabled="True" />
</Series>
</Series>
<ChartAreas>
<ChartArea>
<Area3DStyle Enable3D="false" />
</ChartArea>
</ChartAreas>
<Legends>
<Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
</Legends>
<Titles>
<Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="0, 0, 0"></Title>
</Titles>
</Chart>
</presentationdescription>
<isdefault>false</isdefault>
</visualization>
You can't aggregate separate types in charts. Instead, create a separate field for this and map the data over properly. An on-demand workflow can accomplish this data migration task pretty easily.