Skip to main content

Notifications

Announcements

No record found.

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

  • Verified answer
    Inogic Profile Picture
    500 on at
    RE: Show Top 10 records, order by its its Age - descending Order

    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!

  • Milan Hingu Profile Picture
    375 on at
    RE: Show Top 10 records, order by its its Age - descending Order

    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"

  • Inogic Profile Picture
    500 on at
    RE: Show Top 10 records, order by its its Age - descending Order

    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!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans