Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 26

Qlikview - General Ledger (GL) Dashboard

For Oracle EBS (12.1.x)


Contents

1. Introduction.........................................................................................................................................................2
2. Data Flow.............................................................................................................................................................3
3. Financial Statement Explanation..........................................................................................................................3
5. Packages / Other Objects.....................................................................................................................................8
6. Views...................................................................................................................................................................9
7. Tables to be created...........................................................................................................................................10
8. QVC Components...............................................................................................................................................11
9. Folder Structure.................................................................................................................................................12
10. QVD Generator..............................................................................................................................................12
11. Presentation File............................................................................................................................................14
12. Dashboard Tabs..............................................................................................................................................18
Profit and Loss.......................................................................................................................................................18
KPI’s....................................................................................................................................................................... 19
Balance Sheet........................................................................................................................................................20
Cost Center............................................................................................................................................................21
GL Balance Analysis...............................................................................................................................................22
Cash Flow...............................................................................................................................................................22
GL Journals............................................................................................................................................................23
GL Trial Balance......................................................................................................................................................24
13. Other Important Information.........................................................................................................................24
14. Oracle Scripts for packages and Views...........................................................................................................24
15. Steps to Load the Files...................................................................................................................................24
16. Acknowledgment’s.........................................................................................................................................26

By Ishaq Baig
ishaqbaig@yahoo.com, ibaig@savola.com

1
1. Introduction

The General Ledger (GL) is at the heart of the Accounting system of Oracle eBS. The Oracle General Ledger is the
central repository of accounting information. The main purpose of GL is to record financial activity of the company
and to produce financial and management reports. The GL consolidates financial information from all other
transactional modules or sub-ledgers and maintains summary level information. For example, it stores the
accounting information for a Receivables invoice or an invoice payable to a vendor. It stores accounting entries for
expense for depreciation of an asset or an inventory transfer. It also has accounting entries made within itself using
journal entries.

For more information on Oracle General Ledger, or any other Financial module, refer to the latest User Guide or
the Oracle E-Business Suite Financials Handbook, a handy reference that is recommend for a thorough
understanding of the functional concepts of the financial modules of Oracle EBusiness Suite.

The following diagram is a high level overview of how some of the core modules interact with each other within
Oracle Financials

The GL Analysis Dashboard gives an overview of the following


 Financial Statements (Profit and Loss, Balance Sheet, Cash Flow )
 GL Balance Analysis.
 Cost Center / Expense Analysis.
 Key Performance Indicator (Ratios, Turnover etc.).
 Journal Entry Details.
 Budget Details.

The Dashboard is based on Oracle EBS (E-Business Suite) Version 12.1.1 to 12.1.3. It is directly based on Oracle EBS,
GL related tables. The scripts provided can be created in a separate user/schema which has rights to view APPS
tables and views or they can be created in the APPS schema. All the Views and packages created have a prefix
(XX_).

Access to the GL Data is restricted by using a security table XX_GL_COMPANY_USER_ACCESS. Data in this table
controls the access of users to different Companies.

Technologies Used –
Qlikview Desktop 11.2 (SP5)
Oracle Database 11.2.0.1
PL/SQL

2
2. Data Flow
Create Views and Incremental QVD
Oracle EBS Packages In Oracle Generator Which reads QVW Presentation File
Schema on Tables data from the Created on TOP of the
related to GL underlying Views QVD’s

3. Financial Statement Explanation


Each row of the financial statement is referred as Header. Each header has a Header ID.
Example of a Financial statement
Header
ID Header Name Period Jan-14
PL01 Gross Sales 116,722
PL02 Trade Deals & Promotions 0
PL03 Discounts (29,072)
PLT1 Net Sales 87,649 PL01+PL02+PL03 (Total/Calculated Rows)
PL04 Direct Materials (76,050)
PL05 Freight & Handling (2,040)
PL06 Direct Labor (1,162)
PL07 Manufacturing (1,322)
PL08 Depreciation Expense (89)
PLT2 Total Cost of Sales (80,664) PL04+PL05+PL06+PL07+PL08

PLT1+PLT2 OR
PLT3 Gross Profit 6,986 (PL01+PL02+PL03+PL04+PL05+PL06+PL07+PL08)

To calculate the Header/Row of the Financial Statement. Two methodologist can be adopted.

Method 1 (GL Segment have Numeric Value)


If your GL Segments are having Numeric values ONLY. Then IntervalMatch function is used to generate the Header
of the statement of Account from the GL Balances Table. Headers are being generated on the fly at the reporting /
presentation level.
The mapping for the segments is stored in xls File (GL Report Header Mapping3.xls)

Below Tables show the mapping Example


Interval Match for Segment2 Interval Match for Segment3

HEADER_ID FROM_SEGMENT2 TO_SEGMENT2 HEADER_ID FROM_SEGMENT3 TO_SEGMENT3


PL01 001 ZZZ PL01 5100 5370
PL02 001 ZZZ PL01 5500 5570
PL03 001 ZZZ PL01 5950 5950
PL04 001 ZZZ PL02 5650 5670
PL05 001 ZZZ PL03 5400 5430
PL06 001 399 PL03 5600 5630
PL07 001 399 PL04 6000 6499
PL08 001 399 PL05 6500 6599
PL06 7100 7599
PL07 6600 6699
PL07 7600 8999
PL07 9100 9199
PL07 9200 9599
PL07 9610 9610

3
PL08 6700 6799
Let Infer line one Based on the condition

((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= '999') AND


((GL_BAL_SEGMENT3_VALUE >= '5000' AND GL_BAL_SEGMENT3_VALUE <= '5370') OR
(GL_BAL_SEGMENT3_VALUE >= '5500' AND GL_BAL_SEGMENT3_VALUE <= '5570') OR
GL_BAL_SEGMENT3_VALUE = '5950'))

From the Above we conclude that for Gross Sales line the Segment2 lies between 001 and 999

HEADER_ID FROM_SEGMENT2 TO_SEGMENT2


PL01 001 ZZZ

As Segment3 lies between different sets it has 3 rows


HEADER_ID FROM_SEGMENT3 TO_SEGMENT3
PL01 5100 5370
PL01 5500 5570
PL01 5950 5950

Method 2 (GL Segments have Character Value OR a Complex Combination of different segments)
If your GL Segments are having Alpha Numeric values OR a complex combination of different segments. Then the
Header is being generated using a “WHERE” clause applied to the GL Balances Table and stored in a different table.
The Mapping of where clause is store in the File (GL Report Header Mapping4.xls)

Header
ID Header Name Jan-14 Conditions/Criteria for Creation of Headers
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= 'ZZZ') AND
((GL_BAL_SEGMENT3_VALUE >= '5000' AND GL_BAL_SEGMENT3_VALUE <= '5370') OR
(GL_BAL_SEGMENT3_VALUE >= '5500' AND GL_BAL_SEGMENT3_VALUE <= '5570') OR
PL01 Gross Sales 116,722 GL_BAL_SEGMENT3_VALUE = '5950'))
Trade Deals & ((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= 'ZZZ') AND
PL02 Promotions 0 (GL_BAL_SEGMENT3_VALUE >= '5650' AND GL_BAL_SEGMENT3_VALUE <= '5670'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= 'ZZZ') AND
((GL_BAL_SEGMENT3_VALUE >= '5400' AND GL_BAL_SEGMENT3_VALUE <= '5430') OR
PL03 Discounts (29,072) (GL_BAL_SEGMENT3_VALUE >= '5600' AND GL_BAL_SEGMENT3_VALUE <= '5630')))
PLT1 Net Sales 87,649
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= 'ZZZ') AND
PL04 Direct Materials (76,050) (GL_BAL_SEGMENT3_VALUE >= '6000' AND GL_BAL_SEGMENT3_VALUE <='6499'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= 'ZZZ') AND
PL05 Freight & Handling (2,040) (GL_BAL_SEGMENT3_VALUE >= '6500' AND GL_BAL_SEGMENT3_VALUE <= '6599'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= '399') AND
PL06 Direct Labor (1,162) (GL_BAL_SEGMENT3_VALUE >= '7100' AND GL_BAL_SEGMENT3_VALUE <= '7599'))

((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= '399') AND


((GL_BAL_SEGMENT3_VALUE >= '6600' AND GL_BAL_SEGMENT3_VALUE <= '6699') OR
(GL_BAL_SEGMENT3_VALUE >= '7600' AND GL_BAL_SEGMENT3_VALUE <= '8999') OR
(GL_BAL_SEGMENT3_VALUE >= '9100' AND GL_BAL_SEGMENT3_VALUE <= '9199') OR
(GL_BAL_SEGMENT3_VALUE >= '9200' AND GL_BAL_SEGMENT3_VALUE <= '9599') OR
PL07 Manufacturing (1,322) GL_BAL_SEGMENT3_VALUE = '9610'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= '399') AND
PL08 Depreciation Expense (89) (GL_BAL_SEGMENT3_VALUE >= '6700' AND GL_BAL_SEGMENT3_VALUE <= '6799'))

Using this method the “Where” clause associated with each Header is being applied on the GL Balances Table and
a new row is being inserted into another table which stores the Financial statements rows.

4
There are two Methods based on which two sets of .qvw files have been created (GL Generator and GL Presentation file)

GL Generator QVW GL Company


GL Generator QVW
(Using InterVal Match Grouping.xlsx
(Using Where Clause GL Report Header
Technique) Mapping4.xlsx (File
Technique)
GL Report Header GL Time Series having Where clause for
Mapping3.xlsx (File Measure Types.xlsx each header of the
having Intervals for Financial statement
segment2, segment3)
GL Analysis Using GL Analysis Based on
Oracle Views For Fact
IntervalMatch Header created by the GL
and Dimensions
Generator

Method1 Inputs for the qvw Files Method2


Diagram shows the two techniques used and their respective Files

Technique used for Total Lines

Below table shows how Totals are being taken into consideration. On the Presentation Layer the REP_HEADER_ID,
HEADER_NAME_GRP Fields are shown in the chart which groups up the lines. Now with respect to the calculation
part each line gets it sign automatically from the Views which were created in Oracle. And if needed they are
multiplied by minus in the chart. To get the Net Amount from GL_Balances Table (Debit – Credit) is considered.

Profit and Loss statement Rows /Headers (PL Headers)  need to be multiplied by -1 --> (DR – CR) * -1
Balance Sheets Headers/Rows
Asset Headers (AS Headers)  (DR – CR) No need to multiply by minus
Liabilities Headers (LB Headers)  need to be multiplied by -1 --> (DR – CR) * -1

Rep Header
ID Header Name Jan-14
PL01 Gross Sales 116,722
PL02 Trade Deals & Promotions 0
PL03 Discounts (29,072)
PLT1 Net Sales 87,649
HEADER_ID_GR
HEADER_TYPE P HEADER_NAME_GRP REP_ROW_TYPE REP_ROW_NUMBER REP_HEADER_ID
1 PL01 Gross Sales 1 PL01
Trade Deals &
1 PL02 Promotions 2 PL02
1 PL03 Discounts 3 PL03
1 PL01 Net Sales CALCULATED 4 PLT1
1 PL02 Net Sales CALCULATED 4 PLT1
1 PL03 Net Sales CALCULATED 4 PLT1
1 PL04 Direct Materials 5 PL04
1 PL05 Freight & Handling 6 PL05
1 PL06 Direct Labor 7 PL06
1 PL07 Manufacturing 8 PL07
1 PL08 Depreciation Expense 9 PL08
1 PL04 Total Cost of Sales CALCULATED 10 PLT2
1 PL05 Total Cost of Sales CALCULATED 10 PLT2
1 PL06 Total Cost of Sales CALCULATED 10 PLT2
1 PL07 Total Cost of Sales CALCULATED 10 PLT2
1 PL08 Total Cost of Sales CALCULATED 10 PLT2
1 PL01 Gross Profit CALCULATED 11 PLT3
1 PL02 Gross Profit CALCULATED 11 PLT3
1 PL03 Gross Profit CALCULATED 11 PLT3
1 PL04 Gross Profit CALCULATED 11 PLT3
1 PL05 Gross Profit CALCULATED 11 PLT3
1 PL06 Gross Profit CALCULATED 11 PLT3
1 PL07 Gross Profit CALCULATED 11 PLT3
1 PL08 Gross Profit CALCULATED 11 PLT3
5
Dimensions:

Dimensions Loaded from Oracle Oracle eBS Table


tables

Ledgers GL_LEDGERS
Chart of Accounts GL_CODE_COMBINATIONS
Company  SEGMENT1
Cost Center  SEGMENT2
Account  SEGMENT3 GL_CODE_COMBINATIONS, FND_FLEX_VALUES_B,
Sub-Account  SEGMENT4 FND_FLEX_VALUES_TL
Project  SEGMENT5
Region  SEGMENT6
Fiscal Month GL_PERIOD_SETS, GL_PERIODS
Budgets GL_BUDGETS, GL_BUDGET_VERSIONS
SEGMENT1_HIERARCHY XX_SEGMENT1_HIERARCHY (Hierarchy of Companies)
User Defined Table which stores the company hierarchy

Dimension Loaded from XLS Files


GL Time Series Measures Loaded via XLS file. This file has the Time Series Descriptions
for (YTD, YTD Year Ago, MTD, MTD Year Ago etc.) For More
info on Time Series please refer to the Time Analysis.pdf
Excel Files name  GL Time Series Measure Types.xlsx
Place the file in the ..\GL Folder (C:\Qlikview\GL)

KPI List This sheet has the KPI names, their formulae and sequence.
Loaded from Excel Files name  GL Report Header Mapping4.xlsx
GL Report Header Mapping4.xlsx Place the file in the ..\GL Folder (C:\Qlikview\GL)
(Sheet  KPI List)

GL Report Header Types Report Names


Loaded from
GL Report Header Mapping4.xlsx
(Sheet  Header_Types)
GL Report Header GRP This dimension has the Header/Row names of each line in
Loaded from the Financial statements. Lines are being repeated for
GL Report Header Mapping4.xlsx grouping the total lines
(Sheet  Headers_GRP)
GL Currency Rates By Period.xlsx This xls file stores the Currency rates for a particular period.
This rate can be multiplied with the measures to show the
values based on a particular currency

Facts:

Fact Oracle eBS Table


GL Actual Balance Fact GL_BALANCES (Where Actual_Flag = ‘A’)
(Grain  Segment Level)
Journal Entries and Journal Entry Lines GL_JE_HEADERS, GL_JE_LINES
(Grain -> transactional lines)
GL Budget Balance Fact GL_BALANCES (Where Actual_Flag = ‘B’)
(Grain  Segment Level)
In our ERP instance budget is recorded
only for specific segments in the ERP.
6
Budget for PnL and Balance sheet
headers is saved separately in XLS and
bought into oracle and named as plan.
Plan Fact
(Grain  Header, Company, Period
Level)
Forecast Fact
(Grain  Header, Company, Period
Level)

Explanation of the XLS Files and their Worksheets

1. GL Time Series Measure Types.xlsx  File stores the Periods which will be used to generate the PTD, YTD,
LYPTD etc. values of the measures on the fly using Set Analysis. For more details refer to the Time Analysis pdf
TYPE_KEY TIME_ANALYSIS TIME_PERIOD

CURRENT PTD - Period to Date (Current) PTD

Y-1 LYPTD - Last Year Period to Date LYPTD

P-1 LMPTD - Previous Period LMPTD

YTD YTD - Year to Date YTD

YTD-1 LYYTD - Last Year Year to Date LYYTD

QTD QTD - Quarter to Date QTD

QTD-1 LYQTD - Last Year Quarter to Date LYQTD

MVTOT3 3MPTD - Rolling 3 periods 3MPTD

MVTOT3Y-1 LY3MPTD - Rolling 3 periods Last Year LY3MPTD

MVTOT12 12MPTD - Rolling 12 periods 12MPTD


LY12MPTD - Rolling 12 periods Last
MVTOT12Y-1 Year LY12MPTD

2. GL Company Grouping.xlsx File stores the company group’s information. (users can skip this file if no
external grouping is required)
3. GL Report Header Mapping3.xlsx This excel file has all the header info and the interval of segments. Each
Work Sheet is being explained in detail.

Work Sheet of the xls File


Headers  Has all header/rows descriptions of the statement of accounts
HEADER_I
D HEADER_NAME
PL01 Gross Sales
PL02 Trade Deals & Promotions

Headers_GRP The Total rows are repeated. Which are grouped to get the totals in the Financial statements.
HEADER_ID_GR
HEADER_TYPE P HEADER_NAME_GRP REP_ROW_TYPE REP_ROW_NUMBER REP_HEADER_ID
1 PL01 Gross Sales 1 PL01
Trade Deals &
1 PL02 Promotions 2 PL02
1 PL03 Discounts 3 PL03
1 PL01 Net Sales CALCULATED 4 PLT1
1 PL02 Net Sales CALCULATED 4 PLT1
1 PL03 Net Sales CALCULATED 4 PLT1

7
Header_Types  The different Report names of the Financial statement is stored here.
HEADER_TYPE HEADER_TYPE_NAME
1 Profit & Loss
2 Balance Sheet
3 Cash Flow
4 Cost Center Report

Segment2_Ranges  Interval Match ranges for Segment3_Ranges  Interval Match ranges for
Segment2 of each Header Segment3 of each Header.

HEADER_ID FROM_SEGMENT2 TO_SEGMENT2 HEADER_ID FROM_SEGMENT3 TO_SEGMENT3


PL01 001 ZZZ PL01 5100 5370
PL02 001 ZZZ PL01 5500 5570
PL03 001 ZZZ PL01 5950 5950
PL04 001 ZZZ PL02 5650 5670
PL05 001 ZZZ PL03 5400 5430
PL06 001 399 PL03 5600 5630
PL07 001 399 PL04 6000 6499
PL08 001 399 PL05 6500 6599
PL06 7100 7599

Note  Interval range for Total Rows of the financial statements is not stored in the xls file.

Header_Segments_For_Zeros  Segment2 and segment3 which are candidates for the zeros are saved here.
HEADER_ SEGMEN SEGMEN SEGMENT2_FOR_BUD_FORE SEGMENT3_FOR_BUD_FORE
ID T2 T3 CAST CAST
PL01 053 5110 000 5001
What this row means -> A dummy record is inserted into the fact with zero value for the given segment2,
segment3 values, A dummy record is inserted into GL Balances with given values

Segment3_For_Budget_Forecast  Dummy Segment3 (Accounts)


SEGMENT3_KEY SEGMENT3 SEGMENT3_DESCRIPTION
101-1001 1001 AS01-Total For Budget and Forecast
101-1002 1002 AS011-Total For Budget and Forecast

Additional_Segment3_Ranges  These are additional dummy accounts assigned to each Header. Apart from the
segment3 ranges for each Header defined in the Segment3_Ranges Worksheet.
HEADER_ID FROM_SEGMENT3 TO_SEGMENT3
PL01 5001 5001

4. GL Report Header Mapping4.xlsx This excel file has all the header info and the “WHERE CLAUSE” to
generate the headers. All the Worksheet’s are similar to the sheets described above Except the Headers
Worksheet which has the “WHERE CLAUSE” used to generate the calculated rows.

5. Packages / Other Objects


The Packages script contains the packages needed to created. The packages have some functions which are used
by views to get lookups data.

8
Package Name
APPS_GL_CODE_COMB_UTIL_API Functions to get the GL Segment Description based on the ValueSetID
of the Segment.

In My case the sement4 is a sub segment of segment3. Please note


the difference between Function of Segment3 and segment4. You can
modify the function to suite your needs.

--Following Query can be used to find segments which have sub


segments
SELECT *
FROM fnd_flex_values
WHERE fnd_flex_values.parent_flex_value_low IS NOT NULL
AND fnd_flex_values.flex_value_set_id IN
(SELECT DISTINCT flex_value_set_id
FROM apps.hr_operating_units hou, apps.gl_ledgers gled, fnd_id_flex_segments
WHERE ledger_id = set_of_books_id
AND id_flex_code = 'GL#'
AND id_flex_num = gled.chart_of_accounts_id)

APPS_GL_UTIL_API Functions related to GL Area


APPS_FIN_UTIL_API
FUNCTION XX_Str2Tbl (String to Table) CREATE function xx_str2tbl( p_str in varchar2 ) return xx_myTable
as
Function Reads a string and converts into
l_str long default p_str || ',';
rows l_n number;
Ex l_data xx_myTable := xx_myTable();
begin
90 '30','80','5F' loop
Is Converted to 3 Rows l_n := instr( l_str, ',' );
30 exit when (nvl(l_n,0) = 0);
80 l_data.extend;
l_data(l_data.count) := ( ltrim(rtrim(substr(l_str,1,l_n-1))) );
5F l_str := ltrim( substr( l_str, l_n+1 ) );
end loop;
return l_data;
end;
USER Defined Data Type xx_MYTABLE CREATE TYPE xx_MYTABLE as table of varchar2(25);

6. Views
Views created in Oracle

View Name in Oracle Table Name Unique Key of the Table/View


used in Incremental load
XX_GL_LEDGERS GL_LEDGERS Type 1 Dimension
XX_GL_SEGMENT1 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_SEGMENT2 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_SEGMENT3 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_SEGMENT4 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_SEGMENT5 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
9
FND_FLEX_VALUES
XX_GL_SEGMENT6 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_SEGMENT7 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_SEGMENT8 GL_CODE_COMBINATIONS, Type 1 Dimension
FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
XX_GL_PERIODS Type 1 Dimension
XX_GL_CODE_COMBINATIONS GL_CODE_COMBINATIONS CCID
XX_GL_BALANCES GL_BALANCES GL_BALANCES_KEY
(Concatenated Key)
XX_GL_JE_HEADER GL_JE_HEADERS JE_HEADER_ID
XX_GL_JE_LINE_DETAILS GL_JE_LINES JE_LINE_ID (Concatenation of
je_header_id and
je_line_num)
CREATE VIEW xx_COMPORG
XX_COMPORG This View reads the XX_CONS_3 (CONS_COMP, COMP, CONS_COMP_DESC,
table which has the COMP_DESC ) AS
SELECT consolidated_comp cons_comp,
consolidated companies and its COMP,
(SELECT SEGMENT1_DESCRIPTION
children. This View uses a User FROM XX_GL_SEGMENT1
defined Data Type (xx_mytable) WHERE SEGMENT1 =
consolidated_comp AND rownum = 1 )
and a Function (xx_str2tbl CONS_COMP_DESC,
(SELECT SEGMENT1_DESCRIPTION
String to table) which reads FROM XX_GL_SEGMENT1
the Values from a single line and WHERE SEGMENT1 = comp AND
rownum = 1) COMP_DESC
creates rows. FROM ( SELECT t.consolidated_comp,
t2.COLUMN_VALUE COMP
FROM xx_cons_3 t,
TABLE (
CAST (xx_str2tbl (REPLACE
(t.comp_in, CHR (39))) AS xx_mytable)) t2
ORDER BY 1, 2)
UNION
SELECT NULL cons_comp,
'02' comp,
NULL CONS_COMP_DESC,
'Savola Group Consolidated' COMP_DESC
FROM DUAL;
CREATE VIEW SEGMENT1_HIERARCHY
SEGMENT1_HIERARCHY Segment1 Hierarchy based on (NODEID, PARENTID, NODENAME,
rows in xx_cons_3 table PARENTNODENAME)
AS

SELECT comp NodeID,


cons_comp ParentID,
comp_desc NodeName,
cons_comp_desc ParentNodeName
FROM xx_comporg
CONNECT BY PRIOR comp = cons_comp
START WITH cons_comp IS NULL;

7. Tables to be created
CREATE TABLE Table to grant access to the Qlikview user A particular Company. Insert records
XX_GL_COMPANY_USER_ACCESS into this table to grant access to a particular company to a Qlikview user.
( USER_ACCESS_ORG_ID Example 12, IBAIG
VARCHAR2(100),
15, IBAIG
USERID VARCHAR2(30),
Which means IBAIG has access to 2 Companies.
DISPLAY_NAME VARCHAR2(50),
BOOKMARK_NAME VARCHAR2(50), Also Note  If a user has access to a Parent Company he automatically views the
EMAIL_ADDRESS VARCHAR2(50) data of the child’s associated with the parent.
)

10
COMPAN USERI BOOKMARK_NA EMAIL_ADDRE
Y D DISPLAY_NAME ME SS
GL For Company
02 hqsagl 02 Group hqsagl@.com
GL For Company
30 user30 30 Sub Grp 30 hqsagl@.com
GL For Company
90 user90 90 Sub Grp 90 hqsagl@.com
GL For Company
3A ibaig 3A Sub Grp 3A hqsagl@.com
Below Table Shows sample data in the Access Table
Meaning a user having access to 02 will have access to all companies.
A user having access to 3A will have access to only 3A.

02
90
5F 30 80
3C 3G 8C
3A 84 8F
3B 82
8D

CREATE TABLE Used to restrict the Periods to be loaded for GL_Balances and JE’s (This is used as
DEVELOP.XX_GL_PERIOD_LIST GL_Balances and JE headers has indexes on period_name column)
(
PERIOD_NAME VARCHAR2(6 BYTE)
)
CREATE TABLE XX_CONS_3 Tables stores the Company Hierarchy Information. Using this Table a View is
( created which shows the parent Child relationship between the companies
CONSOLIDATED_COMP VARCHAR2(5
BYTE),
Example Data
COMP_IN VARCHAR2(255 BYTE)
) Cons_Company Company_List
3Z '3A','3B'
8F '82','8D'
8C '84','8F'
80 '8C'
30 '3g','3C'
90 '30','80','5F'
02 '90'

8. QVC Components
Qvc Components for Qlikview were used for incremental load of tables. To incrementally load data from Oracle
Views into the QVD Files.
https://github.com/RobWunderlich/Qlikview-Components
http://code.google.com/p/qlikview-components/downloads/list

Following was the change done in the qvc.qvs script File


Changed the Variable to ORACLE instead of SQLSERVER
SET Qvc.Loader.v.Database = ORACLE;

11
9. Folder Structure
The below Folders can be on any drive (C: or D: …)

10. QVD Generator


The QVD generator loads data from the underlying Oracle Views and stores them into QVD Files. The QVD files are
stored in Folder/Directory set by the variable Qvc.Loader.v.QvdDirectory

Below are the variables which are initialized on startup

// The Default Database


SET Qvc.Loader.v.Database = ORACLE;

// The directory for the QVD file


SET Qvc.Loader.v.QvdDirectory = '..\QVDs\'; //'D:\QlikView\QVDs\';
SET xlsFileLocation = '..\GL\'; //'C:\QLIKVIEW\SOURCEDOCS\';

// How far back to load if First Load


LET Qvc.Loader.v.BaseValue = num(MakeDate(1990,01,01));

// Datetime literal format for Excel - Shipper exercise


SET Qvc.Loader.v.DatabaseDatetimeMask = 'DD/MM/YYYY hh:mm:ss';

// Will the max Modfield value be stored with the QVD?


// The recommended value is True. This will greatly speed up subsequent loads.
SET Qvc.Loader.v.StoreMaxModFieldValue = -1;

//ODBC connection to the Database


//NOTE - PLEASE CHANGE THIS ACCORDING TO YOUR DATABASE
ODBC CONNECT32 TO [visiondb;DBQ=visiondb] (XUserId is AXYMYQBOQbcYH, XPassword is
eSNcXQBOQbcMM);

There is no Difference between two Generator files Except the seconds one has two extra tabs (Rep Header
Generator, Zero Value Records)
GL Generator For InterValMatch.qvw (First File)
GL Generator For WhereClause.qvw (Second File)

Screenshot of the Generator File Tabs

Explanation of the Tabs of QVD Generators


12
Main  Set the Initial Variable and the ODBC connection.

Dimensions  Loads all the dimensions from Oracle View and from xls Files. All the TYPE 1 Dimensions are loaded
fully from oracle on each Reload of the Generator. The second file also loads the “Where Clause”.

CodeComb  Incrementally Loads the GL_CODE_COMBINATIONS records

XX_GL_BALANCES  Incrementally Loads the GL_BALANCES table. (NOTE – Changed Records are saved in QVD to
be processed in the Rep Header Generator Tab)

GL_JE_HEADER_N_LINES  Incrementally Loads the GL_JE_HEADERS, GL_JE_LINES table.

XX_GL_ACTUAL_BALANCES  Loads the Actual records from the QVD of GL_Balances.

XX_GL_BUDGET_BALANCES  Loads the Budget records from the QVD of GL_Balances.

Rep Header Generator  (Present in Second File GL Generator For WhereClause.qvw ONLY). The tab has logic to
Load data into new table by reading the records from the GL_Balances qvd. Data is inserted into two new tables for
Actual and Budget records. Based on the Where clause which is being generated dynamically.

On first load all records from GL_Balances are loaded into the GL_ACTUAL_REP_HEADER table but on subsequent
loads only the changed records of GL Balances are taken into consideration and they are deleted from
GL_ACTUAL_REP_HEADER table and reinserted again.

In Other Words

On First Load from GL_BALANCES are records are taken into consideration and loaded in the
GL_ACTUAL_REP_HEADER table.
On second load only the changed rows of GL_BALANCES which are stored in the
XX_GL_BALANCES_CHANGED_RECS.QVD are taken into consideration. The distinct periods of the changed records
are taken and records of these periods are being deleted from GL_ACTUAL_REP_HEADER table and then
Reinserted into the GL_ACTUAL_REP_HEADER table by reading the GL_BALANCES table.

Logic
Save the Changed rows to XX_GL_BALANCES_CHANGED_RECS.QVD (Done in 3 rd Tab)
FIRST LOAD
LOAD all rows based on the Dynamic Where and Insert into GL_ACTUAL_REP_HEADER.
SECOND LOAD
Get the distinct period from XX_GL_BALANCES_CHANGED_RECS.QVD
Delete the records from GL_ACTUAL_REP_HEADER for the distinct periods
Regenerate the records for these periods and place into GL_ACTUAL_REP_HEADER

Plan and Forecast  Loads the Plan and Forecast of the Headers. The grain of Plan and Forecast is at Header,
Company (Segment1), Period. The Company hierarchy is maintained externally (not in the ERP). In our ERP
instance budget is recorded only for specific segments in the ERP. Budget for PnL and Balance sheet headers is
saved separately in XLS and bought into oracle and named as Plan.

Zero Value Records  Insert zero value records into GL_ACTUAL_REP_HEADER table.

11. Presentation File


The presentation files loads data from the QVD Files and the joins between tables is established here. User is
shown the data in different visual perspectives. The Below diagrams show the relationship established between
the tables for the two presentation files
13
Explanation of the Tabs of Presentation File
Main  Set the Initial Variables.

Dimensions  Loads all the dimensions from QVD Files.

Generator for Zeros  Creates Zero value records to be concatenated with Actual, Budget, Plan and Forecast facts.

Mapping Tab  Mapping tables.

Add Zero Recs to Facts  Concatenate the Zero rows created in Tab3 with Actual, Budget, Plan and Forecast facts.

Sub Load_nAGO, Sub Load_MVTOT, Sub Load_YTD, Generate Time Table  Logic for creating the time table. (For
more info Refer to the Time Analysis.pdf)

Merge Volume To ActRep  Sales Volume records.

Generate Aggregates  Generate Aggregate table.

Fact  All facts are being loaded from their QVD File. (Diagrams explain the Facts in Detail)

JEs  Journal Headers and Lines are loaded from their QVD files

Intervals  (Present in First File GL Analysis For InterVal Match.qvw ONLY). This tab has logic to dynamically
generate the header based on the interval match function. (For more Details refer to the document Interval match
for two ranges.pdf)

Segment1_Hierarchy  Logic to create tables which stores the Hierarchy of the companies. (segment1). Note :-
Segment1 hierarchy is being maintained outside the Oracle ERP system.

Security  Security Tab loads the security Tables. NOTE :- If a user has access to a Parent Company he
automatically views the data of the child’s associated with the parent. Below Diagram shows the Company
hierarchy.

02
90
5F 30 80
3C 3G 8C
3A 84 8F
3B 82
8D

Cons_Compan Company_Lis
14
y t
3Z '3A','3B'
8F '82','8D'
8C '84','8F'
80 '8C'
30 '3g','3C'
90 '30','80','5F'
02 '90'

Loads the data from the QVD files stored in (C:\Qliview\QVDs Folder) into Qlikview Tables. (Diagram on next page
specifies the relationship/joins among the tables and their fields)

15
16
17
12. Dashboard Tabs

Profit and Loss

Profit and Loss Statement The PnL Statement is shown in this tab.
Account level details of the header can also be
viewed

18
KPI’s
Tab show the commonly used KPI and their trend for a particular company. The data fetched in this TAB is based on
the GL_Act_Rep_Header_Aggr table which is generated using GL_Actual_Balance or GL_Act_Rep_Header tables.
(This Tab takes a little time to refresh based on the amount of data)

KPI’s Shows the Trends of Important KPI’s

19
Balance Sheet
Tab shows Balances sheet for the select company. User can also see the details of a particular header/row. Balance
sheet is shown by POSITION. Meaning (Opening Balance of year + Monthly movement)

20
Cost Center
This tab shows the Actual and Budget or last year values for the COST CENTER report. The cost center report is a
report using a set of cost centers. The Budget of the cost centers comes from the oracle ERP.

Cost Center Shows Actual based on the Cost Center Report


type.

21
GL Balance Analysis
GL Actual and Budget Balances for a particular segment can be viewed via this tab.

Cash Flow
Cash Flow details can be viewed via this tab.

The Technique used to create the cashflow report is in the Headers_GRP worksheet of GL Report Header
Mapping4.xlsx file. All the headers /rows of the cash flow report are already calculated via the PnL and Balance
Sheet headers. But for the sign the “REP_ROW_SIGN” field is used.

HEADER_TY HEADER_ID_ HEADER_NAME_ REP_ROW_T REP_ROW_FORM REP_ROW_NUM REP_ROW_SI REP_HEADER


PE GRP GRP YPE ULA BER GN _ID
PL05 + CF01
3 Net Profit Lines 1
PL06 + CF01
3 Net Profit Lines 1
PL07 + CF01
3 Net Profit Lines 1
- CF02
3 CF02 Depreciation Lines 2

22
Deferred Expense
- CF021
3 CF021 Write Off Lines 3

The sign is being used in the expression on the presentation layer file to multiple the value with a –(minus) sign
also note the field HEADER_ID_GRP is used Instead of REP_HEADER_ID

Expression used for Cash Flow Measure

=Sum({<[TIME_PERIOD]={"PTD"}, [HEADER_TYPE]={3}>}
IF(WILDMATCH(HEADER_ID_GRP,'AS*'), ACT_PTD, ACT_PTD*-1) * IF(REP_ROW_SIGN='-',-1,1) *
XRATE_$(vCurrency))/1000

GL Journals
GL Journal Entered can be viewed using this tab.

23
GL Trial Balance
Tab shows the Trial Balance Report.

13. Other Important Information


 All the Tab use common Time Dimensions. For More info on Time Analysis please refer to the below link
 For SET Analysis  http://community.qlik.com/docs/DOC-4951
 For Time Analysis  http://community.qlik.com/docs/DOC-4821
 For Hierarchy  http://community.qlik.com/docs/DOC-5334

 IntervalMatch for two different ranges http://community.qlik.com/thread/139796


 For Any Measures used in the presentation file use the SET ANALYSIS to filter based on the
TIME_PERIOD={"PTD"} (PTD,YTD, Other Values). Otherwise wrong values are shown

14. Oracle Scripts for packages and Views

Table_Scripts.sql Packages_Scripts.sql Function_Scripts.sql Type_Scripts.sql View_Scripts.sql

15. Steps to Load the Files


1) Create the Tables using “Tables_script.sql” file.
2) Create the Packages using “Packages_Script.sql” file.
3) Create the Functions using “Functions_Script.sql” file.
4) Create the Type using “Type_Script.sql” file.
5) Create the Views “Views_Script.sql” file
6) Place the Qvc.qvs script file. In “C:\QlikView\qvc_runtime” Folder

24
7) Identify the mapping used for your Financial statements.
8) Modify the Excel File “GL Report Header Mapping4.xlsx” or “GL Report Header Mapping3.xlsx” according
to your financial statements mapping. Identify the intervals for the segments used in your company.
9) Click Reload in file “GL Analysis - QVD Generator For InterValMatch” or “GL Analysis - QVD Generator For
WhereClause”
Loads Data from the Oracle EBS Database into QVD files, this step creates the QVD file in the
C:\Qlikview\QVDs Folder
(Note- Please replace the ODBC connect with the connection of your database).
10) Click Reload in File “GL – Analysis” . This reloads data from the QVD files to the presentation file.

Reload Screen shot of file “GL Analysis - QVD Generator Incremental”.

Reload Screen shot of file “AP Analysis - QVD Generator Incremental”.

25
16. Acknowledgment’s

The dashboard is a team effort. Sincere thanks to my manager Saiyid Tahir for giving me ideas and Brother
Mohammed Nabeel for creating the presentation layer.

Thanks to Qlik community from where ideas were gathered.

26

You might also like