Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Orderby on aggregate query (alias required)

Posted on by 25

Hi there,

I am trying to apply an orderby to an aggregate query and am getting the following error message back:

{"error":{"code":"0x80041134","message":"An alias is required for an order clause for an aggregate Query."}}

I understand what the error message is saying but am unclear on how to actually resolve the issue. Here is an example of the query:

.../incidents?$filter=statecode eq 0&$groupby((statuscode), aggregate($count as total))&$orderby=statuscode desc

Regards,
Andy

  • Suggested answer
    RE: Orderby on aggregate query (alias required)

    Hello Andy,

    please have a look in the following:

    Query Data using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Docs

    There are a lot of example that can help you to build your query correctly.

    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans