Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to give alias to an aggregate field.

Posted on by Microsoft Employee

Hi,

 

How can I add an alias to an aggregate field.

Following is my code sample:

while select BrandName, count(RecId) from brandsTable
join BrandRecId, ProductName from productsTable
group by brandsTable.BrandName
where brandsTable.RecId == productsTable.BrandRecId
{

.........
}

I want to give an alias to count(RecId):

Thanks,

Tauseef.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to give alias to an aggregate field.

    Thanks Faisal and Crispin.

    Sorry for my stupid questions.

    Actually its been 8 years now I am working on .NET and SQL.

    And I am totally new to AX 2012.

    So, sometimes my mind automatically tends to compare the two.

    So don't mind.

    Thanks a lot.

  • Verified answer
    Faisal Fareed Profile Picture
    Faisal Fareed 10,794 User Group Leader on at
    RE: How to give alias to an aggregate field.

    Hi Tauseef,

    X++ does not have all the functions available of SQL queries so please don't expect you can do everything in AX which is possible in SQL.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to give alias to an aggregate field.

    Thanks a lot Crispin.

    That's what I have used in my while loop and it is giving me the desired result.

    But I was curious to know is there anything like alias in X++ select query.

    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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans