locked
Multiple Series Chart problem for first record in CRM 2011 Chart Customization. RRS feed

  • Question

  • Hello Experts,

    I am facing problem in multiple series chart. The problem is for very first record, its showing wrong value. I drill down and find the following.

    My Chart XML is as this.


    <visualization>
      <visualizationid>{CCEDB491-C863-E311-B14C-005056AE2712}</visualizationid>
      <name>Total Invoice Amount by Territory Manager and Region</name>
      <primaryentitytypecode>account</primaryentitytypecode>
      <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" aggregate="true">
              <entity name="account">
                <attribute aggregate="sum" name="new_total_revenue_cytd_ytd" alias="actual"/>
                <attribute name="new_salestarget" aggregate="sum" alias="target" />
                <attribute name="accountnumber" alias="groupbytm" groupby="true"/>
                <link-entity name="opportunity" from="customerid" to="accountid" link-type="outer">
                  <attribute name="estimatedvalue" aggregate="sum" alias="forcast" />
                </link-entity>
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category alias="groupbytm">
              <measurecollection>
                <measure alias="actual" />
              </measurecollection>
              <measurecollection>
                <measure alias="target" />
              </measurecollection>
              <measurecollection>
                <measure alias="forcast" />
              </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 ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40" LabelFormat="$#,0,,.##M" />
            <Series ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40" LabelFormat="$#,0,,.##M" />
            <Series ChartType="Column" IsValueShownAsLabel="True" Font="{0}, 9.5px" LabelForeColor="59, 59, 59" CustomProperties="PointWidth=0.75, MaxPixelPointWidth=40" LabelFormat="$#,0,,.##M" />
          </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" Format="$#,0,,.##M" />
              </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" />
          </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>

    Please let me know if this a known issue or if there is any solution for the same.

    Any help would be appreciated.

    Friday, March 14, 2014 2:22 PM

All replies

  • You are trying to chart values from two entities at once, which can be done but is much more complex than the method you are using here.

    You are charting values from Account and Opportunity at the same time. Take this scenario:

    You have one Account that has three Opportunities, one of which is closed.

    At the moment your method will either chart each Opportunity separately and show the total YTD for the Account against each one (I think this is what you are seeing), or it would total the Opps but then also total the total YTD (in other words, multiply that single figure from the Account record by three for the three records).

    Also, you are not filtering Opportunities to exclude closed ones, which are either lost (and should not be counted) or are won, in which case they are presumably included in the total YTD figure on the Account record.

    You have two very good options here:
    - flip it to be a chart of Opportunity estimated revenues, summed, categorised by Account number. Add a series for the Total YTD from the parent customer (Account) records and take the MAX or MIN of these (since you get the same figure repeatedly, you don't want to sum them multiple times over). To add fields from the parent record as series or categories, add them as columns in a view (of Opportunities in this case) and use that as the view used to preview the chart while you build it.

    - use Goals. You can total estimated and actual figures directly, and show targets as well. You would have to create one Goal per Account for your model, but you can do this by importing them initially, or programmatically as new Accounts are added.

    Also read this article:

    http://crmchartguy.wordpress.com/2014/02/24/multiple-entities-in-one-ms-crm-chart/


    Hope this helps.
    Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011
    UK CRM Guru Blog

    Sunday, March 16, 2014 11:24 AM