Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Filter the records which has zero value after Sum(field) x++ / Query class / View

(0) ShareShare
ReportReport
Posted on by 770

Hi All, 

This job will iterate 1500 records in queryRun as per my query. That's correct. Among that, there 5 records only has Qty > 0. How can i filter the same in above query class?

I have added group by of Item Id and InventDimId. And Sum of Qty field.

Thanks.

7888.QueryClass.jpg

  • Martin Dráb Profile Picture
    232,968 Most Valuable Professional on at
    RE: Filter the records which has zero value after Sum(field) x++ / Query class / View

    We can do it. With "having", mentioned above.

    By the way, if you wanted to do it in T-SQL, you would need the same thing: HAVING.

  • Community Member Profile Picture
    on at
    RE: Filter the records which has zero value after Sum(field) x++ / Query class / View

    Hi,

    I don't think we can filter on the sum of qty in the query.

    But it's feasible to make it with T-sql and the post below explain how to make it.

    (community.dynamics.com/.../executing-direct-sql-statements)

    regards,

  • Suggested answer
    Martin Dráb Profile Picture
    232,968 Most Valuable Professional on at
    RE: Filter the records which has zero value after Sum(field) x++ / Query class / View

    Which version of AX is it about? You can do it with "having", which was introduced in AX 2012, I think. Another approach would be using a summarized view.

  • WillWU Profile Picture
    22,352 on at
    RE: Filter the records which has zero value after Sum(field) x++ / Query class / View

    Moved to Dynamics AX forum.

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 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,206 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,968 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans