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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

GroupBy and Count on Gen. Journal Line

(0) ShareShare
ReportReport
Posted on by 10

I am trying to get count of unique Document No that are grouped by Document Type and Journal Batch Name fields. Currently i can display these fields directly and it shows document no.

This is what i am expecting

Document Type Journal Batch Name Document Count
Default

1

Invoice TestEntry April 5
Payment Test 2

I tried to Querying Gen. Journal Line and provided method sum but got this result

Document Type Journal Batch Name Document Count
Default 8
Invoice TestEntry April 8
Payment Test

8

Payment Default

8

Invoice Test

8

Invoice Default

8

Please let me know how i can get count of document numbers with Groupby on Document Type and Journal Batch Name

Regards

  • Suggested answer
    Chameera Kavinda Profile Picture
    510 on at

    Hi LordSAK

    Please try below Query

    query 50100 LineCount
    {
        QueryType = Normal;

        elements
        {
            dataitem(GenJournalLine; "Gen. Journal Line")
            {
                column(Count_)
                {
                    Method = Count;
                }
                column(DocumentType; "Document Type")
                {
                }
                column(JournalBatchName; "Journal Batch Name")
                {
                }
            }
        }
    }
  • LordSAK_ Profile Picture
    10 on at

    hi Chameera. I tried what you suggested and it gave me no result

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 720 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 436 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 409 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans