You are on page 1of 29

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


KPIs................................................................................................................................... 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.

Acknowledgments....................................................................................................... 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
Oracle EBS

Incremental
QVD Generator
Which reads
data from the
underlying

Create Views
and Packages
In Oracle
Schema on

QVW
Presentation
File Created on
TOP of the

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

PL01

Gross Sales

PL02

Trade Deals & Promotions

PL03

Discounts

PLT1

Net Sales

PL04

Direct Materials

PL05

Freight & Handling

(2,040)

PL06

Direct Labor

(1,162)

PL07

Manufacturing

(1,322)

PL08

Depreciation Expense

PLT2

Total Cost of Sales

PLT3

Perio
d

Jan-14
116,722
0
(29,072)
87,649

PL01+PL02+PL03 (Total/Calculated Rows)

(76,050)

(89)
(80,664)

Gross Profit

6,986

PL04+PL05+PL06+PL07+PL08
PLT1+PLT2 OR
(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

HEADER_ID

FROM_SEGMENT2

TO_SEGMENT2

PL01

001

ZZZ

PL02

001

ZZZ

PL03

001

ZZZ

PL04

001

ZZZ

PL05

001

ZZZ

PL06

001

399

PL07

001

399

PL08

001

399

Interval Match for Segment3


HEADER_I
D

FROM_SEGMENT3

TO_SEGMENT
3

PL01

5100

5370

PL01

5500

5570

PL01

5950

5950

PL02

5650

5670

PL03

5400

5430

PL03

5600

5630

PL04

6000

6499

PL05

6500

6599

PL06

7100

7599

PL07

6600

6699

PL07

7600

8999

PL07

9100

9199

PL07

9200

9599

PL07

9610

9610

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_I
D

FROM_SEGMENT3

TO_SEGMENT
3

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

PL01

Gross Sales

116,722

PL02

Trade Deals &


Promotions

PL03

Discounts

(29,072)

PLT1

Net Sales

87,649

PL04

Direct Materials

PL05

Freight & Handling

(2,040)

PL06

Direct Labor

(1,162)

PL07

Manufacturing

(1,322)

PL08

Depreciation Expense

(76,050)

(89)

((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
GL_BAL_SEGMENT3_VALUE = '5950'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= 'ZZZ')
AND (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
(GL_BAL_SEGMENT3_VALUE >= '5600' AND GL_BAL_SEGMENT3_VALUE <=
'5630')))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <=
'ZZZ') AND
(GL_BAL_SEGMENT3_VALUE >= '6000' AND GL_BAL_SEGMENT3_VALUE
<='6499'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <=
'ZZZ') AND
(GL_BAL_SEGMENT3_VALUE >= '6500' AND GL_BAL_SEGMENT3_VALUE <=
'6599'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <= '399')
AND
(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
GL_BAL_SEGMENT3_VALUE = '9610'))
((GL_BAL_SEGMENT2_VALUE >= '001' AND GL_BAL_SEGMENT2_VALUE <=
'399') AND
(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.

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

GL Generator
QVW (Using
InterVal Match
Technique)

GL Report
Header
Mapping3.xls
x (File having
Intervals for
segment2,
segment3)

GL Generator
QVW (Using
Where Clause
Technique)

GL Time
Series
Measure
Types.xlsx

GL Analysis
Using
IntervalMatch

GL Analysis
Based on
Header created
by the GL

Oracle Views
For Fact and
Dimensions

Method1

GL Report
Header
Mapping4.xls
x (File having
Where clause
for each
header of the
Financial
statement

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

PL01

Jan-14
116,722

PL02

Gross Sales
Trade Deals &
Promotions

PL03

Discounts

(29,072)

PLT1
HEADER_TYP
E
1

Net Sales
HEADER_ID_GR
P
PL01

1
1
1
1
1

PL02
PL03
PL01
PL02
PL03

HEADER_NAME_GR
P
Gross Sales
Trade Deals &
Promotions
Discounts
Net Sales
Net Sales
Net Sales

REP_ROW_TYP
E

CALCULATED
CALCULATED
CALCULATED

REP_ROW_NUMBE
R
1
2
3
4
4
4

87,649
REP_HEADER_I
D
PL01
PL02
PL03
PLT1
PLT1
PLT1

1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

PL04
PL05
PL06
PL07
PL08
PL04
PL05
PL06
PL07
PL08
PL01
PL02
PL03
PL04
PL05
PL06
PL07
PL08

Direct Materials
Freight & Handling
Direct Labor
Manufacturing
Depreciation Expense
Total Cost of Sales
Total Cost of Sales
Total Cost of Sales
Total Cost of Sales
Total Cost of Sales
Gross Profit
Gross Profit
Gross Profit
Gross Profit
Gross Profit
Gross Profit
Gross Profit
Gross Profit

CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED
CALCULATED

5
6
7
8
9
10
10
10
10
10
11
11
11
11
11
11
11
11

PL04
PL05
PL06
PL07
PL08
PLT2
PLT2
PLT2
PLT2
PLT2
PLT3
PLT3
PLT3
PLT3
PLT3
PLT3
PLT3
PLT3

Dimensions:
Dimensions Loaded from Oracle
tables

Oracle eBS Table

Ledgers
Chart of Accounts
Company
SEGMENT1
Cost Center SEGMENT2
Account
SEGMENT3
Sub-Account SEGMENT4
Project
SEGMENT5
Region
SEGMENT6
Fiscal Month
Budgets
SEGMENT1_HIERARCHY

GL_LEDGERS
GL_CODE_COMBINATIONS

GL_CODE_COMBINATIONS, FND_FLEX_VALUES_B,
FND_FLEX_VALUES_TL

GL_PERIOD_SETS, GL_PERIODS
GL_BUDGETS, GL_BUDGET_VERSIONS
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
Loaded from
GL Report Header Mapping4.xlsx
(Sheet KPI List)

This sheet has the KPI names, their formulae and


sequence.
Excel Files name GL Report Header
Mapping4.xlsx
Place the file in the ..\GL Folder
(C:\Qlikview\GL)

GL Report Header Types

Report Names

Loaded from
GL Report Header Mapping4.xlsx
(Sheet Header_Types)

GL Report Header GRP


Loaded from
GL Report Header Mapping4.xlsx
(Sheet Headers_GRP)

GL Currency Rates By
Period.xlsx

This dimension has the Header/Row names of


each line in the Financial statements. Lines are
being repeated for grouping the total lines
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
GL_JE_HEADERS, GL_JE_LINES
Entry 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. 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_PERIO
D

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

MVTOT3Y-1

3MPTD - Rolling 3 periods


LY3MPTD - Rolling 3 periods Last
Year

MVTOT12
MVTOT12Y1

12MPTD - Rolling 12 periods


LY12MPTD - Rolling 12 periods Last
Year

12MPTD

LY3MPTD

LY12MPTD

2. GL Company Grouping.xlsx File stores the company groups 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_TYP
E

HEADER_ID_GR
P

HEADER_NAME_GR
P

REP_ROW_TYP
E

REP_ROW_NUMBE
R

REP_HEADER_I
D

PL01

PL01

PL02

Gross Sales
Trade Deals &
Promotions

PL02

PL03

Discounts

PL03

PL01

Net Sales

CALCULATED

PLT1

PL02

Net Sales

CALCULATED

PLT1

PL03

Net Sales

CALCULATED

PLT1

Header_Types The different Report names of the Financial statement is stored here.
HEADER_TYPE

HEADER_TYPE_NAME

Profit & Loss

Balance Sheet

Cash Flow

Cost Center Report

Segment2_Ranges Interval Match


ranges for Segment2 of each Header
HEADER_ID

FROM_SEGMENT2

TO_SEGMENT2

PL01

001

ZZZ

PL02

001

ZZZ

PL03

001

ZZZ

PL04

001

ZZZ

PL05

001

ZZZ

PL06

001

399

PL07

001

399

PL08

001

399

Segment3_Ranges Interval Match


ranges for Segment3 of each Header.
HEADER_I
D

FROM_SEGMENT3

TO_SEGMENT
3

PL01

5100

5370

PL01

5500

5570

PL01

5950

5950

PL02

5650

5670

PL03

5400

5430

PL03

5600

5630

PL04

6000

6499

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_
ID

SEGME
NT2

SEGME
NT3

SEGMENT2_FOR_BUD_FOR
ECAST

SEGMENT3_FOR_BUD_FOR
ECAST

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_I
D

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 Worksheets 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.
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
APPS_FIN_UTIL_API
FUNCTION XX_Str2Tbl (String
to Table)
Function Reads a string and
converts into rows
Ex
'30','80','5F
90
'
Is Converted to 3 Rows
30
80
5F
USER Defined Data Type
xx_MYTABLE

Functions related to GL Area


CREATE function xx_str2tbl( p_str in varchar2 ) return xx_myTable
as
l_str long default p_str || ',';
l_n
number;
l_data xx_myTable := xx_myTable();
begin
loop
l_n := instr( l_str, ',' );
exit when (nvl(l_n,0) = 0);
l_data.extend;
l_data(l_data.count) := ( ltrim(rtrim(substr(l_str,1,l_n-1))) );
l_str := ltrim( substr( l_str, l_n+1 ) );
end loop;
return l_data;
end;
CREATE TYPE xx_MYTABLE as table of varchar2(25);

6. Views
Views created in Oracle
View Name in Oracle
XX_GL_LEDGERS
XX_GL_SEGMENT1
XX_GL_SEGMENT2
XX_GL_SEGMENT3

10

Table Name
GL_LEDGERS
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS

Unique Key of the


Table/View used in
Incremental load
Type 1 Dimension
Type 1 Dimension
Type 1 Dimension
Type 1 Dimension

, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES
GL_CODE_COMBINATIONS
, FND_FLEX_VALUES_TL,
FND_FLEX_VALUES

XX_GL_SEGMENT4
XX_GL_SEGMENT5
XX_GL_SEGMENT6
XX_GL_SEGMENT7
XX_GL_SEGMENT8
XX_GL_PERIODS
XX_GL_CODE_COMBINATIONS
XX_GL_BALANCES

GL_CODE_COMBINATIONS
GL_BALANCES

XX_GL_JE_HEADER
XX_GL_JE_LINE_DETAILS

GL_JE_HEADERS
GL_JE_LINES

XX_COMPORG

This View reads the


XX_CONS_3 table which
has the consolidated
companies and its
children. This View uses a
User defined Data Type
(xx_mytable) and a
Function (xx_str2tbl
String to table) which
reads the Values from a
single line and creates
rows.

SEGMENT1_HIERARCHY

Segment1 Hierarchy
based on rows in
xx_cons_3 table

Type 1 Dimension
Type 1 Dimension
Type 1 Dimension
Type 1 Dimension
Type 1 Dimension
Type 1 Dimension
CCID
GL_BALANCES_KEY
(Concatenated Key)
JE_HEADER_ID
JE_LINE_ID
(Concatenation of
je_header_id and
je_line_num)
CREATE VIEW xx_COMPORG
(CONS_COMP, COMP,
CONS_COMP_DESC, COMP_DESC ) AS
SELECT consolidated_comp cons_comp,
COMP,
(SELECT SEGMENT1_DESCRIPTION
FROM XX_GL_SEGMENT1
WHERE SEGMENT1 =
consolidated_comp AND rownum = 1 )
CONS_COMP_DESC,
(SELECT SEGMENT1_DESCRIPTION
FROM XX_GL_SEGMENT1
WHERE SEGMENT1 = comp AND
rownum = 1) COMP_DESC
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
(NODEID, PARENTID, NODENAME,
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
XX_GL_COMPANY_USER_ACCESS
( USER_ACCESS_ORG_ID
VARCHAR2(100),
USERID
VARCHAR2(30),

11

Table to grant access to the Qlikview user A particular Company.


Insert records into this table to grant access to a particular
company to a Qlikview user.
Example 12, IBAIG
15, IBAIG

DISPLAY_NAME
VARCHAR2(50),
BOOKMARK_NAME
VARCHAR2(50),
EMAIL_ADDRESS
VARCHAR2(50)
)

Which means IBAIG has access to 2 Companies.


Also Note If a user has access to a Parent Company he
automatically views the data of the childs associated with the
parent.

COMPAN
Y

USERI
D

02

hqsagl

30

user30

90

user90

3A

ibaig

DISPLAY_NAME
GL For Company
02
GL For Company
30
GL For Company
90
GL For Company
3A

BOOKMARK_NA
ME

EMAIL_ADDRE
SS

Group

hqsagl@.com

Sub Grp 30

hqsagl@.com

Sub Grp 90

hqsagl@.com

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
3C

80
3G
3A

8C
84

3B

8F
82
8D

CREATE TABLE
DEVELOP.XX_GL_PERIOD_LIST
(
PERIOD_NAME VARCHAR2(6
BYTE)
)
CREATE TABLE XX_CONS_3
(
CONSOLIDATED_COMP
VARCHAR2(5 BYTE),
COMP_IN
VARCHAR2(255
BYTE)
)

Used to restrict the Periods to be loaded for GL_Balances and JEs


(This is used as GL_Balances and JE headers has indexes on
period_name column)

Tables stores the Company Hierarchy Information. Using this Table


a View is created which shows the parent Child relationship
between the companies
Example Data
Cons_Compa
ny
3Z
8F
8C
80
30
90
02

12

Company_L
ist
'3A','3B'
'82','8D'
'84','8F'
'8C'
'3g','3C'
'30','80','5F
'
'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;

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\';
SET xlsFileLocation = '..\GL\';

//'D:\QlikView\QVDs\';
//'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)

13

Screenshot of the Generator File Tabs

Explanation of the Tabs of QVD Generators


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
14

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

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.
15

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

02
90
5F

30
3C

80
3G
3A
3B

8C
84

8F
82
8D

Cons_Comp
any

Company_
List

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)

16

17

18

19

12. Dashboard Tabs


Profit and Loss

Profit and Loss Statement

20

The PnL Statement is shown in this


tab. Account level details of the
header can also be viewed

21

KPIs
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)

KPIs

22

Shows the Trends of Important KPIs

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)

23

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

24

Shows Actual based on the Cost


Center Report type.

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_T
YPE
3
3
3

25

HEADER_ID_
GRP
PL05
PL06
PL07

HEADER_NAME
_GRP

REP_ROW_T
YPE

REP_ROW_FOR
MULA

REP_ROW_NU
MBER

Net Profit

Lines

Net Profit

Lines

Net Profit

Lines

REP_ROW_S
IGN

REP_HEADE
R_ID

CF01

CF01

CF01

CF02

CF021

Depreciation
Deferred Expense
Write Off

Lines

Lines

CF02

CF021

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.

26

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

15. Steps to Load the Files


1)
2)
3)
4)
5)
27

Create
Create
Create
Create
Create

the
the
the
the
the

Tables using Tables_script.sql file.


Packages using Packages_Script.sql file.
Functions using Functions_Script.sql file.
Type using Type_Script.sql file.
Views Views_Script.sql file

View_Scripts.sql

6) Place the Qvc.qvs script file. In C:\QlikView\qvc_runtime Folder


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.

28

16. Acknowledgments
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.

29

You might also like