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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2012 segmented entry and group by

(0) ShareShare
ReportReport
Posted on by

Hi

I created a table with LedgerDimension field among other fields. I build a form using a grid control to show this table. I used segmented entry to show account and dimensions. This form works correctly.

Now I want to show data grouped by account and dimensions.

I created a new data source, which include the same data as the first one, but I modified data source by using "group by" option in query in init method. I gruped by ledgerDimension.

Now my form shows bad data.

Only record with focus has correct data.

What is wrong? How to show data gruped by ledgerDimension?

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    we are not able see the atatched screen shorts please upload it again

    it is required to understand your issue.

  • Kumar Gaurav @ MS Profile Picture
    on at

    can you please clarify if you are trying to group by whole ledger dimension or part of ledger dimension . if it is whole ledger dimension than it's probably the place where you are putting data is causing this issue. May be a more detailed problem statement can help.

  • Community Member Profile Picture
    on at

    I found the solution.

    Statement in script in DAX:

    select PPLDecreeLine;

    Statement in SQL:

    SELECT FIRSTFAST * FROM PPLDecreeLine(PPLDecreeLine) USING INDEX Idx1

    OUTER JOIN DisplayValue

    FROM DimensionAttributeValueCombination(Ref_DimensionAttributeValueCombination_LedgerDimension1)

    ON PPLDecreeLine.LedgerDimension = DimensionAttributeValueCombination.RecId

    I added to my query:

    qbds = this.query().dataSourceName("PPLDecreeLine");

        //sort
        qbds.clearSortIndex();
        qbds.addSortIndex(indexNum(PPLDecreeLine, Idx3));

        //group
        qbds.clearRanges();
        qbds.sortClear();
        qbds.fields().clearFieldList();
        qbds.orderMode(OrderMode::GroupBy);
        qbds.addGroupByField(fieldnum(PPLDecreeLine, DecreeId));
        qbds.addGroupByField(fieldnum(PPLDecreeLine, AccountType));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, LedgerDimension));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, DefaultDimension));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, PostingProfile));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, ProjCategoryId));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, ProjLinePropertyId));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, SysDebitCredit));
        qbds.addGroupByField(fieldNum(PPLDecreeLine, DecreeTxtId));

        //sum
        qbds.addSelectionField(fieldnum(PPLDecreeLine, Debit), SelectionField::Sum);
        qbds.addSelectionField(fieldnum(PPLDecreeLine, Credit), SelectionField::Sum);

         // new field in group by

        qbds2 = this.query().dataSourceTable(tableNum(DimensionAttributeValueCombination));
        if (qbds2)
        {
            qbds2.sortClear();
            qbds2.fields().clearFieldList();
            qbds2.orderMode(OrderMode::GroupBy);
            qbds2.addGroupByField(fieldnum(DimensionAttributeValueCombination, DisplayValue));
        }

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans