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)

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
    682 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
    682 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

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