Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Query base view adding...
Finance forum

Query base view adding all fields to the group by clause

(0) ShareShare
ReportReport
Posted on by 105

I made a view based on a OAT Query that joined the VendPackingSlipTrans table with the PurchLine table and group them by the PurchId and the ActivityNumber fields to sum Qty and AmountMST. I used the view in a form and I realized that the view is not being group by the PurchId and the ActivityNumber fields.  I went to see the view directly to the SQL Database and see that the physical resulting view adds all the fields to the group by giving an unwanted result. Is there any way to avoid this?

  • Suggested answer
    Emilio Molina Profile Picture
    105 on at
    RE: Query base view adding all fields to the group by clause

    Thanks a lot for you help. I was expecting that because on my query I already have the fields summarized, the resulting view will work pretty much the same as If i used the query in  X++, in the sense that the fields will have the sum value itself. I just realized that this is not the way it works. You will have to used the aggregated function in the view for each field all over again.

  • István Orosz Profile Picture
    2,137 on at
    RE: Query base view adding all fields to the group by clause

    Hi,

    Would you provide some more details on the view please? I mean AOT definition, mainly how did you made the grouping and the SUM in the view?

  • Jie G Profile Picture
    on at
    RE: Query base view adding all fields to the group by clause

    Hi Emilio,

    You can  try to create view on tables. Here is a step by step guide for your reference:

    community.dynamics.com/.../how-to-create-view-in-dynamics-365

  • André Arnaud de Calavon Profile Picture
    294,255 Super User 2025 Season 1 on at
    RE: Query base view adding all fields to the group by clause

    Hi Emilio,

    Can you describe in detail how you defined the view and what is the current and expected outcome (examples)?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 232,984 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans