web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

View Field Aggregation

(0) ShareShare
ReportReport
Posted on by 1,214

Hi. I'm reading View Basics documentation. On the Fields section:

"A view can return aggregate fields that use the functions SUM, MIN, MAX, AVG, and COUNT. Field aggregation is specified in the Aggregation property of the field. In Microsoft Dynamics AX, views support only field-level aggregation."

what does it mean by field-level aggregation?

In the meantime, I'm working on InventValueReportView which is a union of a lot of other Views. One of them is InventValueFinancialAdjustment:

inventvaluefinancialadjustment.png

When I run 

select * from INVENTVALUEFINANCIALADJUSTMENT

and it's respective query based on the view datasource
select * from INVENTTRANS
join INVENTTRANSORIGIN on INVENTTRANS.INVENTTRANSORIGIN = INVENTTRANSORIGIN.RECID
join INVENTSETTLEMENT on INVENTTRANS.RECID = INVENTSETTLEMENT.TRANSRECID
where SETTLEMODEL != 7

they're not returning the same total records. Query number 1 always returns less number of records. 

Does this has anything to do with the Sum of Amount aggregation in the view? How does this field-level aggregation affects the original query? How are the records being grouped?

Thank You

*This post is locked for comments

I have the same question (0)
  • HAIRUL HAZRI Profile Picture
    1,214 on at
    RE: View Field Aggregation

    Anybody can answer this? Do these questions ambiguous or something?

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: View Field Aggregation

    Hi,

    Without any group-by clause in the query, the records with same value for the same fields in the view (that are not aggregated fields) should be aggregated, in order to show the proper information in the aggregated fields.

    Look at this example:

    Table 1
    Field 1 Field 2 Qty
    ste x 10
    ste x 20
    ste x 30
    ste y 40

    If you use the Table 1 as your query datasource, and create one new view using this query, the result should be something like this:

    View 1
    Field 1 Field 2 SumOfQty
    ste x 60
    ste y 40

    As you can see, the first 3 lines have the same values for the Field 1 and Field 2, so in the view these rows are aggregated in order to show the sum of the Qty field in the aggregated field, and it's the reason why the View shows less number of records than the table.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

#2
NNaumenko Profile Picture

NNaumenko 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans