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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Show Top 10 records, order by its its Age - descending Order

(0) ShareShare
ReportReport
Posted on by 375

Dear All,

I am facing an issue.

My requirement is very simple but i dont know why it is not able to get into the application.

There is a Calculated Field on Opportunity which calculates Opportunity records age by its formula.

Now i want to show top 10 most aged Opportunity in a chart. Very Simple one, right ?

Yes it seems simple as we can show my calculated column in Y axis and Opportunity in X axis and its done.

But i want top 10 records descending to its age.

My Chart data description is as below.

<datadescription>
    <datadefinition>
      <fetchcollection>
        <fetch mapping="logical" aggregate="true" top="10">
          <entity name="opportunity">
            <attribute name="opportunityid" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
            <attribute name="wn_age" aggregate="max" alias="_CRMAutoGen_aggregate_column_Num_0" />
            <order alias="_CRMAutoGen_aggregate_column_Num_0" descending="true" />
          </entity>
        </fetch>
      </fetchcollection>
      <categorycollection>
        <category alias="_CRMAutoGen_groupby_column_Num_0">
          <measurecollection>
            <measure alias="_CRMAutoGen_aggregate_column_Num_0" />
          </measurecollection>
        </category>
      </categorycollection>
    </datadefinition>
  </datadescription>

Still its not showing correct result.

Where i can be wrong ?

Please help. Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Inogic Profile Picture
    762 on at

    Hi Milan,

    Please replace your Chart data description from  top= “10” with count="10" as highlighted below in bold:

    <datadescription>
        <datadefinition>
          <fetchcollection>
            <fetch mapping="logical" aggregate="true" count="10">
              <entity name="opportunity">
                <attribute name="opportunityid" groupby="true" alias="_CRMAutoGen_groupby_column_Num_0" />
                <attribute name="wn_age" aggregate="max" alias="_CRMAutoGen_aggregate_column_Num_0" />
                <order alias="_CRMAutoGen_aggregate_column_Num_0" descending="true" />
              </entity>
            </fetch>
          </fetchcollection>
          <categorycollection>
            <category alias="_CRMAutoGen_groupby_column_Num_0">
              <measurecollection>
                <measure alias="_CRMAutoGen_aggregate_column_Num_0" />
              </measurecollection>
            </category>
          </categorycollection>
        </datadefinition>
      </datadescription>

    Thanks!

  • Milan Hingu Profile Picture
    375 on at

    Then it give me an error..

    "The Data Description for the visualization is invalid as it does not specify an order node for the count attribute"

  • Verified answer
    Inogic Profile Picture
    762 on at

    Please follow below steps:

    Here in my case rank is calculated field on Account entity, and need to display account record by rank in descending order, so firstly edit view sorting in descending order for rank field. As you can check in below screen-shot.

    FQ2.jpg

    1. Now I am showing only top 2 records as per rank in descending order. For this follow steps mentioned in below screenshot:

    FQ2.jpg

    Now enter no of records you want to show on dashboard.(in your case you have to enter 10 here)

    FQ3.jpg

    Hope this helps.

    Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans