Creating a dimensional model to represent GL data is relatively straightforward. Basically the goal is to capture 3 fact areas: Actual Balances, Budget Balances, and Journal Entries. Typically the model will consist of 2 fact tables: GL_Balances and GL_Journal_Entries. With this design Actual and Budget measures are both part of the GL_Balances fact. They may be represented on separate rows and differentiated by a foreign key to a dimension that indicates “Actual” or “Budget”, or they may be pivoted and placed right next to one another. The latter scenario is often preferable because it makes it very easy to represent Actual-to-Budget comparisons in reports. Journal Entry data must be in a separate fact table because the granularity is lower than that of the GL_Balances fact. However, both fact tables will share several dimensions:
Set of Books
Account Type (Revenue, Expense, Asset, Equity, Liability)
Chart of Accounts
This technical brief will focus on how to design and build the Chart of Accounts dimension(s).
The Chart of Accounts (COA) is a concept that is common to most accounting systems. It is a list of all the accounts that are tracked by the accounting system. The COA is often represented as a hierarchy but may or may not actually implement a strict one-to-many relationship from top to bottom. This is an important point because identifying this characteristic is critical to developing the appropriate design. If the COA is represented as a strict hierarchy, then a single COA dimension table can be used. If not, then it may be necessary to create a dimension table for each level in the COA.
In Oracle EBS, the COA is identified in the transaction records by a field called CODE_COMBINATION_ID. This field maps back to the table GL_CODE_COMBINATIONS, which holds the hierarchy in fields called Segment1, Segment2, Segment3, etc. The business meaning of the fields can be found by querying the some of the FND tables:
FROM fnd_id_flex_segments fs, fnd_id_flexs f
WHERE fs.id_flex_code = f.id_flex_code
AND f.application_table_name = 'GL_CODE_COMBINATIONS';
The results of this query will look something like this. This information is helpful to determine appropriate table and/or columns names for the COA dimension table(s).
SEGMENT2 Commercial Unit
Getting the data for the dimension also requires queries against the FND tables. The approach will be different depending on which design is chosen. If the COA can be implemented as a single dimension table then following query is a good start.
Approach 1 – Query to Generate the COA Hierarchy for a single COA Dimension:
SELECT gcc.segment1 company_cd,
FROM gl_code_combinations gcc,
WHERE fvc.flex_value_set_id =
WHERE flex_value_set_name = 'XX_COMPANY')
AND fvc.flex_value_meaning = gcc.segment1
AND fvcu.flex_value_set_id =
WHERE flex_value_set_name = 'XX_COMMERCIAL_UNIT')
AND fvcu.flex_value_meaning = gcc.segment2
AND fvb.flex_value_set_id = (SELECT flex_value_set_id
WHERE flex_value_set_name = 'XX_BRANCH')
AND fvb.flex_value_meaning = gcc.segment3
AND fvd.flex_value_set_id =
WHERE flex_value_set_name = 'XX_DEPARTMENT')
AND fvd.flex_value_meaning = gcc.segment4
AND fva.flex_value_set_id =
WHERE flex_value_set_name = 'XX_ACCOUNT')
AND fva.flex_value_meaning = gcc.segment5
ORDER BY 1, 3, 5, 7, 9
If the design calls for separate dimension tables for each level within the COA then one approach is to build a View that will act as the single source for each dimension table. The code below displays how this is done.
Approach 2 – DDL for a view that will act as the data source for each COA-related dimension table:
CREATE OR REPLACE VIEW "GL_COA_V" ("COA_FLEX_VALUE_ID",
SELECT DISTINCT fvt.flex_value_id coa_flex_value_id,
FROM fnd_flex_values fv,
WHERE fv.flex_value_id = fvt.flex_value_id
AND fvs.flex_value_set_id = fv.flex_value_set_id
AND fvs.flex_value_set_name IN
AND fvt.source_lang = 'US'
ORDER BY 1;
Approach 2 – Query against the view to generate the data for a dimension table representing an individual COA segment:
SELECT coa_flex_value_meaning branch_cd,
WHERE coa_flex_value_set_name = 'XX_BRANCH';
A query, similar to the one above, would be used to generate the dimension table for each segment of the COA. The only change necessary would be the column name and the filter in the WHERE clause.
The Chart of Accounts is a fundamental accounting concept and the heart of a GL data mart. It is the glue that ties GL Balances to Journal Entries and it enables drill-down capabilities that are so crucial to financial analysis. Implementing the COA dimension is not difficult, but determining where to find the data within EBS may be challenging for someone that is experienced with the data model. The approaches detailed above should be a good starting point for anyone who is beginning to design a finance or GL data mart.