web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Combining charts OR filtering/grouping by [Related]

(0) ShareShare
ReportReport
Posted on by

Hello all!  I'll jump right into it:

I have a single-series chart supplied with a view for total cases closed last_month.  The series is by "Site Location".  We have 3 actual sites we refer to as "CC" "17" and "T" but our administrator has broken these sites up in CRM so there are multiple Site Locations split up by a wing name or nearby address.  Here's a comparison of what I see vs what I'd like to see:

1680.charts.png

What I'd like to see is cases closed for the entire site in one bar.  This can be done easily by creating a list that includes only the Site Locations of one of the Sites.  But I can only do one chart for one site at a time.  This causes a problem since when I have a dashboard with the Sites separated, the axis values vary and I can't visually compare the performance of the sites.

I can think of two solutions but I don't know how to go about it.  The first is to create a chart that lumps together a few columns and aggregates the count.  Thankfully, the administrator standardized the Site Location names.  I checked the FetchXML for a view that isolates cases based on Site Location "Begins with..." - This was the result:

      <filter type="or">
        <condition attribute="dell_sitelocationidname" operator="like" value="xxx-cc%" />
        <condition attribute="dell_sitelocationidname" operator="like" value="xxx-t%" />
        <condition attribute="dell_sitelocationidname" operator="like" value="xxx-17%" />
      </filter>


So I have the attribute name.  Can I aggregate results in a chart using a value like above?  And do this with more than one column in a chart?

The other solution I heard of was to create 3 different charts and somehow have them referenced/combined in a 4th separate chart but I have no idea how that would be possible.

This is the current, simple xml.  I only changed the alias names, I haven't modified anything else yet:

<visualization>
  <visualizationid>{62203035-8ED2-E511-8382-005056AB3BAD}</visualizationid>
  <name>By Site</name>
  <primaryentitytypecode>incident</primaryentitytypecode>
  <datadescription>
    <datadefinition>
      <fetchcollection>
        <fetch mapping="logical" aggregate="true">
          <entity name="incident">
            <attribute groupby="true" alias="groupby_column" name="dell_sitelocationid" />
            <attribute alias="aggregate_column" name="xxx_urgency" aggregate="count" />
          </entity>
        </fetch>
      </fetchcollection>
      <categorycollection>
        <category alias="groupby_column">
          <measurecollection>
            <measure alias="aggregate_column" />
          </measurecollection>
        </category>
      </categorycollection>
    </datadefinition>
  </datadescription>
  <presentationdescription>
    <Chart Palette="None" PaletteCustomColors="91,151,213; 237,125,49; 160,116,166; 255,192,0; 68,114,196; 112,173,71; 37,94,145; 158,72,14; 117,55,125; 153,115,0; 38,68,120; 67,104,43; 124,175,221; 241,151,90; 186,144,192; 255,205,51; 105,142,208; 140,193,104; 50,125,194; 210,96,18; 150,83,159; 204,154,0; 51,90,161; 90,138,57;">
      <Series>
        <Series ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40"></Series>
      </Series>
      <ChartAreas>
        <ChartArea BorderColor="White" BorderDashStyle="Solid">
          <AxisY LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
            <MajorGrid LineColor="239, 242, 246" />
            <MajorTickMark LineColor="165, 172, 181" />
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
          </AxisY>
          <AxisX LabelAutoFitMinFontSize="8" TitleForeColor="59, 59, 59" TitleFont="{0}, 10.5px" LineColor="165, 172, 181" IntervalAutoMode="VariableCount">
            <MajorTickMark LineColor="165, 172, 181" />
            <MajorGrid LineColor="Transparent" />
            <LabelStyle Font="{0}, 10.5px" ForeColor="59, 59, 59" />
          </AxisX>
        </ChartArea>
      </ChartAreas>
      <Titles>
        <Title Alignment="TopLeft" DockingOffset="-3" Font="{0}, 13px" ForeColor="59, 59, 59"></Title>
      </Titles>
      <Legends>
        <Legend Alignment="Center" LegendStyle="Table" Docking="right" IsEquallySpacedItems="True" Font="{0}, 11px" ShadowColor="0, 0, 0, 0" ForeColor="59, 59, 59" />
      </Legends>
    </Chart>
  </presentationdescription>
  <isdefault>false</isdefault>
</visualization>


*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    I figured out the answer to my first question:  Yes.  I made 3 separate <link-entity>'s and applied a filter to each one.  Used aggregate="countcolumn" for each so it wouldn't just pull the total.  Made a series for each and labeled it appropriately in the LegendText=  

    Here's my final result and the xml.  Hopefully this will help someone else in the future.

    By-Site.png

    <fetchcollection>
            <fetch mapping="logical" aggregate="true">
              <entity name="incident">
                <attribute name="servicestage" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
                <link-entity name="incident" from="incidentid" to="incidentid" link-type="outer">
                  <attribute name="incidentid" aggregate="countcolumn" alias="xxx_cc" />
                  <filter type="and">
                    <condition attribute="dell_sitelocationidname" operator="like" value="xxx-cc%" />
                  </filter>
                </link-entity>
                <link-entity name="incident" from="incidentid" to="incidentid" link-type="outer">
                  <attribute name="incidentid" aggregate="countcolumn" alias="xxx_t" />
                  <filter type="and">
                    <condition attribute="dell_sitelocationidname" operator="like" value="xxx-t%" />
                  </filter>
                </link-entity>
                <link-entity name="incident" from="incidentid" to="incidentid" link-type="outer">
                  <attribute name="incidentid" aggregate="countcolumn" alias="xxx_17" />
                  <filter type="and">
                    <condition attribute="dell_sitelocationidname" operator="like" value="xxx-17%" />
                  </filter>
                </link-entity>
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category alias="_CRMAutoGen_groupby_column_Num_0">
              <measurecollection>
                <measure alias="xxx_cc" />
              </measurecollection>
              <measurecollection>
                <measure alias="xxx_17" />
              </measurecollection>
              <measurecollection>
                <measure alias="xxx_t" />
              </measurecollection>
            </category>
          </categorycollection>

    And the series

          <Series>
            <Series ChartType="Column" IsValueShownAsLabel="True" LegendText="CC" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=85, DrawSideBySide=True" />
            <Series ChartType="Column" IsValueShownAsLabel="True" LegendText="17th BLVD" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=2, MaxPixelPointWidth=85, DrawSideBySide=True" />
            <Series ChartType="Column" IsValueShownAsLabel="True" LegendText="Tyrannosaurus" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=85, DrawSideBySide=True" />
          </Series>

    (Names changed for security purposes)
  • gavibe Profile Picture
    92 on at

    Hi EchoHeadache,

    FYI - this has helped me so thank you for posting your solution. I have a further query on this in regard to my own problem. I am trying to do a simple chart or two series that counts the number of cases activated and number resolved in one week. Problem I have is that if I start a new cases and resolve it in the same week, that figure is moved from activated to resolved and not accounted for in activated as well as resolved. (Hope that makes sense!)

    How can I include that figure in both columns? Here is my code:

    CaseStatusDate is a custom calculated field based on if case = active use createdon date else if case = resolved use modifiedon date.

    <fetchcollection>

       <fetch mapping="logical" aggregate="true">

         <entity name="incident">

           <attribute alias="Day" name="casestatusdate" groupby="true" dategrouping="day" />

           <filter type="and">

             <condition attribute="casestatusdate" operator="last-seven-days" />

           </filter>

           <link-entity name="incident" from="incidentid" to="incidentid" link-type="outer">

             <attribute alias="Active" name="statecode" aggregate="countcolumn" />

             <filter type="and">

               <condition attribute="statecode" operator="eq" value="0" />

               <condition attribute="casestatusdate" operator="last-seven-days" />

             </filter>

           </link-entity>

           <link-entity name="incident" from="incidentid" to="incidentid" link-type="outer">

             <attribute alias="Resolved" name="statecode" aggregate="countcolumn" />

             <filter type="and">

               <condition attribute="statecode" operator="eq" value="1" />

               <condition attribute="casestatusdate" operator="last-seven-days" />

             </filter>

             </link-entity>

         </entity>

       </fetch>

     </fetchcollection>

     <categorycollection>

       <category alias="Day">

         <measurecollection>

           <measure alias="Active" />

         </measurecollection>

         <measurecollection>

           <measure alias="Resolved" />

         </measurecollection>

       </category>

     </categorycollection>

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans