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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

SQL Query to calculate actuals / budget

(0) ShareShare
ReportReport
Posted on by 43

Dear Guys,

What are the SQL tables to calculate actuals / budget?

I'm writing a SSRS report that needs to group both.

regards,

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

    Hi Ahmed,

    There are quite some tables involved. You can look at standard reports in the application to learn which queries need to be created supported by some x++ logic or not. There are some transaction tables, but Microsoft created a lot of views supporting easier access and flattening the data model. I don't know all objects names by head.

    Anyway, is the requirement that specific that configuration of the Financial reporter is not giving the expected results for your requirement?

  • AhmedFad Profile Picture
    43 on at

    Thanks André for the reply

    I tried to reverse engineer some of the budget screens, and built some queries.

    This is one for the actuals, for example:

    SELECT T1.FOCUSLEDGERDIMENSION AS f1, T2.ACCOUNTINGCURRENCYAMOUNT AS f2, 1 AS RECVERSION, 5637144576 AS PARTITION
    FROM DIMENSIONFOCUSLEDGERDIMENSIONREFERENCE T1
             CROSS JOIN GENERALJOURNALACCOUNTENTRY T2
             CROSS JOIN GENERALJOURNALENTRY T3
             CROSS JOIN DIMENSIONATTRIBUTEVALUECOMBINATION T4
             CROSS JOIN MAINACCOUNT T5
    WHERE ((T1.PARTITION = 5637144576) AND ((T1.FOCUSDIMENSIONHIERARCHY = 5637144589) AND
                                            (((T3.ACCOUNTINGDATE >= {ts '2023-01-01 00:00:00.000'}) AND
                                              (T3.ACCOUNTINGDATE <= {ts '2023-01-31 00:00:00.000'})) AND (T5.TYPE = 2))))
      AND ((T2.PARTITION = 5637144576) AND (T1.ACCOUNTENTRYLEDGERDIMENSION = T2.LEDGERDIMENSION))
      AND ((T3.PARTITION = 5637144576) AND
           (((T3.POSTINGLAYER = 0) AND (T3.LEDGER = 5637145326)) AND (T2.GENERALJOURNALENTRY = T3.RECID)))
      AND ((T4.PARTITION = 5637144576) AND (T2.LEDGERDIMENSION = T4.RECID))
      AND ((T5.PARTITION = 5637144576) AND ((T5.LEDGERCHARTOFACCOUNTS = 5637144576) AND (T4.MAINACCOUNT = T5.RECID)))
      AND EXISTS(SELECT 'x'
                 FROM FISCALCALENDARPERIOD T6
                 WHERE ((T6.PARTITION = 5637144576) AND (NOT ((T6.TYPE = 2)) AND (T3.FISCALCALENDARPERIOD = T6.RECID))))
    ORDER BY T1.FOCUSDIMENSIONHIERARCHY, T1.ACCOUNTENTRYLEDGERDIMENSION

    now my next hurdle is:

    how to implement this query in X , especially the cross joins.

    Any ideas guys?

    thanks in advance

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 612

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 589 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans