Featured Post

Dynamics GP 2019 is now Released

It is now released, Microsoft Dynamics GP 2019 which moves the system to the modern product life cycle   " Beginning with the October...

Sunday, February 1, 2015

General Ledger Journals with Multi Dimensional Analysis Details – SQL Script

For analysis details in the General Ledger module, some companies consider the AA (Analytical Accounting) module while others consider the MDA (Multi Dimensional Analysis). A previous post provided an SQL script for General Ledger Journals with Analytical Accounting Details –SQL Script, now it is important to proceed and provide an SQL script for the MDA details.

 MDA - Data Set

 

Tables Included:

- DTA10100 | Transaction Analysis Groups
- DTA10200 | Transaction Analysis Codes
- GL00100  | Account Master
- GL00105  | Account Index Master

 

SELECT  CASE A.DTASERIES
         WHEN 2 THEN 'Financial'
         WHEN 3 THEN 'Sales'
         WHEN 4 THEN 'Purchasing'
         WHEN 5 THEN 'Inventory'
         WHEN 6 THEN 'Payroll – USA'
         WHEN 7 THEN 'Project'
         ELSE ''
        END AS DTA_Series ,
        JRNENTRY AS JournalEntry,
        D.ACTNUMST AS AccountNumber,
        C.ACTDESCR AS AccountDescription,
        A.GROUPID AS DTA_GroupID,
        CODEID AS DTA_CodeID,
        GROUPAMT ,
        CASE
         WHEN CODEAMT > 0 THEN CODEAMT
         ELSE 0
        END AS Debit,
        CASE
         WHEN CODEAMT < 0 THEN CODEAMT
         ELSE 0
        END AS Credit,
        A.TRXDATE  AS TransactionDate,
        A.DTAREF AS DTA_Reference,
        DTA_GL_Reference ,
        A.DOCNUMBR AS OriginalDocumentNumber ,
        A.RMDTYPAL ,
        CASE PSTGSTUS
         WHEN 1 THEN 'Unposted'
         WHEN 2 THEN 'Posted'
         ELSE ''
        END AS DTA_PostingStatus ,
        B.DOCNUMBR ,
        B.RMDTYPAL ,
        POSTDESC AS PostingDescription,
        DTAQNTY
        FROM    dbo.DTA10100 AS A
        LEFT OUTER JOIN dbo.DTA10200 AS B ON A.ACTINDX = B.ACTINDX
        AND A.DOCNUMBR = B.DOCNUMBR
        AND A.DTAREF = B.DTAREF
        AND A.DTASERIES = B.DTASERIES
        AND A.GROUPID = B.GROUPID
        AND A.SEQNUMBR = B.SEQNUMBR
        LEFT OUTER JOIN dbo.GL00100 AS C ON A.ACTINDX = C.ACTINDX
        LEFT OUTER JOIN dbo.GL00105 AS D ON C.ACTINDX = D.ACTINDX 

 

Best Regards,
Mahmoud M. AlSaadi

3 comments:

  1. Interesting blog post. It was informative. Thanks for sharing...

    accounting firm in dubai

    ReplyDelete
  2. Thanks for this wonderful article. Very useful and effective. keep share more and more article. Business Restructuring in UAE

    ReplyDelete
  3. BE SMART AND BECOME RICH IN LESS THAN 3DAYS....It all depends on how fast 
    you can be to get the new PROGRAMMED blank ATM card that is capable of
    hacking into any ATM machine,anywhere in the world. I got to know about 
    this BLANK ATM CARD when I was searching for job online about a month 
    ago..It has really changed my life for good and now I can say I'm rich and 
    I can never be poor again. The least money I get in a day with it is about 
    $50,000.(fifty thousand USD) Every now and then I keeping pumping money 
    into my account. Though is illegal,there is no risk of being caught 
    ,because it has been programmed in such a way that it is not traceable,it 
    also has a technique that makes it impossible for the CCTVs to detect 
    you..For details on how to get yours today, email the hackers on : (
    atmmachinehackers1@gmail.com ). Tell your 
    loved once too, and start to live large. That's the simple testimony of how 
    my life changed for good...Love you all ...the email address again is ;
    atmmachinehackers1@gmail.com

    ReplyDelete