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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Group by year in projforecast tables

(0) ShareShare
ReportReport
Posted on by 10

Hello,

     I have a project ranging from 1/1/2018 to 1/1/2020. I have different forecasts entered for items for 2018,2019 and 2020. Now i want to get the forecast records per each year grouping by category using a job. Can anyone suggest me how to achieve this? Thanks for your help.

for example if i have entered a forecast for item for category"X"  in 2018, and also for same category i have entered one more record for year 2018. Now my job should pull two records one for 2018 and other for 2019. 

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    304,040 Super User 2026 Season 1 on at

    Hi DK ram,

    You can achieve it in two ways:

    1) use the select statement where you select the fields you want to retrieve and sum of amounts using the 'group by' statement

    docs.microsoft.com/.../select-statement-syntax

    select field1, field2, sum(field3), sum(field4) from table
    group by field1, field2
    where field 4 == myVariable;

    2) Create a query in the AOT: Query Elements in the AOT | Microsoft Docs

  • DK ram Profile Picture
    10 on at

    Hi Andre,

      Thanks for your reply. i wanted to use  "group by year(date)  from table" in select statement, as I wanted to get the records per year.  is this possible?

  • Martin Dráb Profile Picture
    239,087 Most Valuable Professional on at

    Unfortunately you can't do write such a thing in X++. But there is a workaround - create a view with a computed column returning the year for each date. Then you can group by this computed column.

    By the way, which version of AX is it about? If AX 2012, you should choose "Microsoft Dynamics AX 2012" as the version. If it's about D365FO, you should ask in one of D365FO forums.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 689

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 308 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans