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)

Sorting a chart with a link-entity

(0) ShareShare
ReportReport
Posted on by 285

I have a question on sorting. I'm using a linked entity (below is the fetch portion), is there any way to get this to sort properly using the aggregate column? I've tried to put order tags in at the entity and link-entity level (and both) nothing seems to have any effect. Thanks

<fetch mapping="logical" aggregate="true">
   <entity name="p_account">
      <attribute alias="aggregate_column" name="p_accountvalue" aggregate="sum" />
         <link-entity name="b_acct" from="b_acctid" to="b_p_accountid" link-type="outer">
            <attribute groupby="true" alias="groupby_column" name="plantype" />
         </link-entity>
   </entity>
</fetch>

*This post is locked for comments

I have the same question (0)
  • suresh maurya Profile Picture
    630 on at

    For testing of FetchXML, you can test here online http://msxrmtools.com

  • Suggested answer
    sandeepstw Profile Picture
    4,601 on at

    Hi Taylor,

    Yes, use like this

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

      <entity name="p_account">

         <attribute alias="aggregate_column" name="p_accountvalue" aggregate="sum" />

        <order attribute="p_accountvalue" descending="false" />

            <link-entity name="b_acct" from="b_acctid" to="b_p_accountid" link-type="outer">

               <attribute groupby="true" alias="groupby_column" name="plantype" />

            </link-entity>

      </entity>

    </fetch>

    Please verify my answer!!

    Thanks,

    Sandeep

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi Taylor,

      sorting can only be done on the primary entity fields, I believe.

    https://crmchartguy.wordpress.com/2012/08/23/order-or-sort-your-charts/

    "Order clauses can only be set for fields on the primary entity"

    So you can't order by plantype..

    On the other hand, you can't order by p_accountvalue either because it's what you aggregate on, not what you group on (well, at least it does not make sense to order by individual values)

    If you wanted to order by aggregated value (by sum), this might work:

    us.hitachi-solutions.com/.../crm-2011-dashboard-sorting-a-chart-on-the-aggregate-value

    PS. Come on guys.. stop bringing those old posts back to live:) Just realized it's a 3 years old question..

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