Announcements
No record found.
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.
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
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?
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 694
André Arnaud de Cal... 646 Super User 2026 Season 1
CP04-islander 337