You are on page 1of 51

2017

BISP Solutions Inc.


Ashima Rajput

[FDMEE WRITING IMPORT AND MAPPING SCRIPT]


This document provides various examples as to how to use import and mapping script. There are four
examples used in it, they provide various ways to apply import and mapping scripts.

www.bispsolutions.com www.bisptrainings.com
Contents

 Overview of Scripts
 Exercise#1 Import script with string expression.
 Exercise#2 Import Script with conditional expression.
 Exercise#3 Mapping Script with IGNORE expression.
 Exercise#4 Import Script with StrRecord Function

Overview of Scripts: Oracle Hyperion Financial Data Quality Management, Enterprise Edition having
great power and strength because of extensive framework by offering Jython and Visual Basic scripting
so that user has wider area for customize the product which is well suited for their needs.

There are instances when source data not in the same format as required by target application
therefore some changes and data massaging is required with data. With Jython or VB script, data
massaging job turns out to be quite flexible. Jython script empowers developers to customize the source
data to the greatest extent. i.e There are two amount columns in our Source File, one for credit amount
and other for debit amount, so we need to convert two columns into one based on condition
Amount=debit-credit.

Script Editor: With the help of script Editor, we write Jython script in FDMEE. Scripts are saved with .py
extension. Every script saved under scripts folder. Scripts can be copied into other FDMEE environments
and one can edit scripts using text Editor.

How to Launch Script Editor

Setup -scripts -- script Editor

Fig 1.1 Script Editor


Types of Scripts in FDMEE
I. Import scripts
II. Mapping scripts
III. Event scripts
IV. Custom scripts

I. Import scripts: Import script only supported by Jython script, so far visual basic script not
supported. These scripts support only file-based data loads. One can use any Jython
functions with Import scripts. Note file name of Import script and function Name should be
same. For our flexibility we always write script in text editor than paste it into FDMEE editor.

When source files are successfully imported than Import scripts will be executed.

These scripts not supported LCM in FDMEE.

Function passes two parameters.


 First parameter takes dimension value defined by the import format.
 In other parameter it takes entire record from the source.

Exercise#1
In this Example, the account column is a complete string i.e 01-205-A0065-0000-000 and we need to
apply string split function in order to extract certain subset of the string.
Input String : 01-205-A0065-0000-000
Expected Output: Account: A0065

Source: file(SCRIPT1Dl.TXT)

Target: drcrLoad

Script type: Import script

Sample Data file.

1. Login to workspace and open FDMEE.

Navigate -Administer -- Data Management


2.Go to setup tab Register Source system.

SetupRegister-source system

Here you can see File (source system) is already registered.

If you want to register any other source simply click on plus icon and you can add here.

For add new Source system: SetupRegister-source system-add

Provide name for source system, select source system likewise fill other details than save it.
3.Go to setup tab Register Target Application.

SetupRegister-Target Application

Here you can see some of the Target applications are already registered. My Target Application name is
DrcrLoad.

If you want to register any other Target, simply click on plus icon and you can add here.

For add new Target application.

SetupRegister- Target application -add

Click on add, select application window will appear, from dropdown select Type of Target application,
name of application will appear ,select one of them click on ok.
Dimension mapping details populated automatically, this refers to staging table. Market, Product,
Customers, Entity, are generic dimension. Account is Account Type and Market is country dimension.

4. Now in next step, define import format, we define source data type which we want to load to target
application.

Setup - Integration Setup


Setup - Integration Setup Import Format

If Import format not present in list than add it by click on add button, you will have option below to add
new import format, fill all the details like Name of import format than source Type, Source File etc. File
Type Delimited means your source file contains which type of delimiter in my case it is comma. Click on
save than need to define Mapping Type.
Here define mapping based on your source File provide source column name, and Field Number of
source. For Ex in my Source file account number 01-205-A0065-0000-000 is First field so you can view in
Import format Account Map with field number 1 .

This is my Source file.

5. Now we write script.

Setup-Scripts--Script Editor---Import

Here select your Target Application as drcrload, and Technology as Jython.


For creating new script.

Setup-Scripts--Script Editor---Import---New

Script Name and function definition should be exactly same. Function takes two parameters, field
name and record name. Parameter#1 strfield contains whole record as row from your file and strrec
contains value for dimension on which we are applying script, i.e here we have Account. So in script we
give condition if strfield contain “–“ more than zero times than need to split the field and store into
seglist array. Now in next step we want third string A0065 so we pass second index (remember index
start from zero) of seglist and store it into new variable result and return it into account.
Script

This is the one way of writing script for this problem. and below script can also use for same problem.

Now we give reference of this script into Import Format. Click on Account and select pencil Icon under
add expression over their click on it. Choose Expression Type as script, select Expression value. Click ok,
then save it.
6.Location: Once we define Import Format define Location Here if location not available in list than click
on add button and fill related details.

Setup - Integration Setup Location

To Specify new Location, give any name to Location provide Import Format Name which you gave in
last step once you provide Import format system automatically fetch all other details related to source
and Target. Then click on save.

7. Period Mapping: suppose we want to load data for Jan 2016 so we can specify this into Period
mapping. Period mapping is used to map source data(File) to Target dimension which is period
dimension. we can define mapping at different levels like Global, Application, source system.

Setup - Integration Setup Period Mapping


8.Category Mapping: If category exist under category list which you want to load into target dimension
than select it or otherwise create them.

Setup - Integration Setup Category Mapping

For creating New click on add provide source system data to Target Scenario dimension member.

9.we need to set Data Load Mapping. but first select POV (Point of view).
Data Load: In this Part of FDMEE We will see process of Data Load and validation of data and finally how
we export data from ERP to EPM system.

Data Load
Data Load Mapping: We use Data Load Mapping for map source dimension member to their target
Application Dimension member. We have Location, Period, Category set of Mappings for Data Load
Mapping. For that we need to select for which member we want to load data like in my case I choose
Account as a dimension than we have types of Mapping choose one of them then click on add then fill
all details. We need to specify mapping for each dimension.

Setup - Data Load -- Data Load Mapping

Dimension- Account

Dimension- Customers
Dimension- Market

Dimension- Entity

Dimension- ICP
Dimension- Product

10. Data Load Rule: We need to create data Load rule for location and category to describe what we are
going to import from ERP system. For prepare Data Load Rule click on plus icon Fill all the details like
provide any suitable Name to your Data Load Rule, Choose File Type here we are loading data for single
period. Than choose Import Format which you Prepared.

After that in Source Option select File Name Which you want to Load.

Workflow -- Data Load - Data Load Rule

Basically, data load rule represents our file which we want to import with other details once we
complete data load rule we need to save it so execute button enabled than click on it here Execute
rule window will appear here we need to specify one or more periods. Run it than you will see one
process id has created than verify it by click on save

11. Data Load Workbench


Here we can see our data successfully Loaded.
We can see in Target Account A0065 is loaded successfully.

Data for other dimension loaded.


Excel output

Exercise#2 : The 2nd exercise demonstrate string function, type case and conditional expression. We
get source file which has two amount columns, one for credit amount and other for debit amount, so we
need to store Amount as Amount=Debit-credit which means convert two Amount columns into one
column.

Expected Output: Amount: Amount for A00065 will be 340, Amount for A00066 will be 200.and for
A0067 will be 15.

Source system-File (MULTIdata.txt).

Target system-Essbase cube(Mul_peri-Mul_db).

Script type: Import script


1.In First step we login to workspace and open FDMEE.

Navigate -Administer -- Data Management

2.Go to setup tab Register Source system.

SetupRegister-source system.

Here you can see File (source system) is registered already.

If you want to register any other source simply click on plus icon and you can add here.

For add new Source system: SetupRegister-source system-add

Provide name for source system, select source system likewise fill other details than save it.

3.Go to setup tab Register Target Application.

SetupRegister-Target Application
Here you can see some of the Target application is registered already. My Target Application name is
Mul_peri-Mul_db.

If you want to register any other Target, simply click on plus icon and you can add here.

For add new Target application.

SetupRegister- Target application -add

Click on add than window will appear, from dropdown select Type of Target application, then Name of
application will appear select one of them click on ok.

Here you can see all the details comes automatically related to dimension mapping this refers to staging
table. Market, Product, Customers, Entity, ICP are generic dimension and Account is Account Type
dimension. You can view in detail in your Target application by seeing dimension type. These all sets
automatically.
4.Now in next step define import format here we define map to source. We also define script in Import
format.

Setup - Integration Setup


My import format present in list name as Multi_IF.

Setup - Integration Setup Import Format

If Import format not present in list than add it by click on add button you will have option below to add
new import format fill all the details like Name of import format than source Type, Source File etc. File
Type Delimited means your source file contains which type of delimiter in my case it is comma. Click on
save than need to define Mapping Type.

Here define Mapping based in your source File provide Source column name than Field Number of
source.
5.Now we write Import script.

Setup-Scripts--Script Editor---Import

Here select your Target Application and Technology as Jython.

For creating new script.

Setup-Scripts--Script Editor---Import---New

Script Name and definition of function should be exactly same. Function takes two parameters field
name, record Name.

strRecord contains full data record means, string record contains full value of a row.so when we use split
function with strRecord so we can get credit value. remember index start from zero.so credit Amount
present on 7th index.
Import format we define Amount field as debit amount so strfield contain record which is present in
Amount in import format like in our case Amount present on 9th field in Import format.

Now we need to apply condition for Amount field. . Here our logic was very simple if debit amount is
zero than amount will be negative if credit is not zero, and if credit is zero than amount should remain
same as debit. and if in case debit credit both contains some value in this case Amount=debit-credit.

Script

Now we give reference of this script into Import Format. this script we written for Amount dimension so,
click on Amount and you can see pencil Icon under add expression over their click on it. choose
Expression Type as script. Than select Expression value. Click ok, then save it.
6.Location: Once we define Import Format define Location Here if location not available in list than click
on add button and fill related details.

Setup - Integration Setup Location

To Specify new Location, give any name to Location provide Import Format Name which you gave in
last step once you provide Import format system automatically fetch all other details related to source
and Target. Then click on save.

7.Period Mapping: suppose we want to load data for Jan 2016 so we can specify this into Period
mapping. Period mapping is used to map source data(File) to Target dimension which is period
dimension. we can define mapping at different levels like Global, Application, source system.

Setup - Integration Setup Period Mapping


8.Category Mapping: If category exist under category list which you want to load into target dimension
than select it or otherwise create them.

Setup - Integration Setup Category Mapping

For creating New click on add provide source system data to Target Scenario dimension member.

9.we need to set Data Load Mapping. but first select POV (Point of view).

Data Load: In this Part of FDMEE We will see process of Data Load and validation of data and finally how
we export data from ERP to EPM system.
Data Load
Data Load Mapping: We use Data Load Mapping for map source dimension member to their target
Application Dimension member. We have Account, customer, Entity, ICP, market, Product. set of
Mappings for Data Load Mapping. For that we need to select for which member we want to load data
like in my case I choose Account as a dimension than we have types of Mapping choose one of them
then click on add then fill all details. We need to specify mapping for each dimension.

Setup - Data Load -- Data Load Mapping

Dimension- Account
Dimension- Customers

Dimension- Market

Dimension- Entity
Dimension- ICP

Dimension- Product

10.Data Load Rule: We need to create data Load rule for location and category to describe what we are
going to import from ERP system. For prepare Data Load Rule click on plus icon Fill all the details like
provide any suitable Name to your Data Load Rule, Choose File Type here we are loading data for single
period. Than choose Import Format which you Prepared.

After that in Source Option select File Name Which you want to Load.

Workflow -- Data Load - Data Load Rule


Basically, data load rule represents our file which we want to import with other details once we
complete data load rule we need to save it so execute button enabled than click on it here Execute
rule window will appear here we need to specify one or more periods. Run it than you will see one
process id has created than verify it by click on save

11.Data Load Workbench


Here we can see our data successfully Loaded. View in Amount column.
Workbench output

Excel output

II. Mapping Script


This type of scripting generally we use when we want to apply conditional Mapping.

In these scripts source members directly not going to map with Target members, first we map source
members to script expression than it maps to target.

Mapping script written with dimension Mapping.

We use if ..then logic for conditional mapping.

Mapping script not supported Explicit and Multi-dimension mapping.

How to create.

Workflow-Data Load Mapping-Like tab-Choose Dimension--select source value-Target


value write #SCRIPT.

1.Mapping Script Example:

Exercise#3

Here in this Example we skip those lines where amount is less than Zero with "IGNORE "option else map
all with Account members for target.

Expected output: Write IGNORE with less than zero Amount in Account column.

Source system: dataload1.txt

Target system: sample-Basic

Mapping Type: Mapping Script

Source file:

1.In First step we login to workspace and open FDMEE.

Navigate -Administer -- Data Management

2.Go to setup tab Register Source system.


SetupRegister-source system

Here you can see File (source system) is registered already.

If you want to register any other source simply click on plus icon and you can add here.

For add new Source system: SetupRegister-source system-add

Provide name for source system, select source system likewise fill other details than save it.

3.Go to setup tab Register Target Application.

SetupRegister-Target Application
Here you can see some of the Target application is registered already. My Target Application name is
Sample-Basic.

If you want to register any other Target, simply click on plus icon and you can add here.

For add new Target application.

SetupRegister- Target application -add

Click on add than window will appear, from dropdown select Type of Target application, then Name of
application will appear select one of them click on ok.

Here you can see all the details comes automatically related to dimension mapping this refers to staging
table. Market, Product, Scenario are generic dimension and Year is Period Type and Measures is Account
dimension. You can view in detail in your Target application by seeing dimension type. These all sets
automatically.

4Now in next step define import format here we define map fields to source to Target.
Setup - Integration Setup

Setup - Integration Setup Import Format

If Import format not present in list than add it by click on add button you will have option below to add
new import format fill all the details like Name of import format than source Type, Source File etc. File
Type Delimited means your source file contains which type of delimiter in my case it is comma. Click on
save than need to define Mapping Type.
Here define Mapping based on your source File provide Source column name than Field Number of
source.

5.Location: Once we define Import Format define Location Here if location not available in list than click
on add button and fill related details.

Setup - Integration Setup Location

To Specify new Location, give any name to Location provide Import Format Name which you gave in
last step once you provide Import format system automatically fetch all other details related to source
and Target. Then click on save.

6.Period Mapping: suppose we want to load data for Jan 2012 so we can specify this into
Period mapping. Period mapping is used to map source data(File) to Target dimension which is
period dimension. we can define mapping at different levels like Global, Application, source
system.
Setup - Integration Setup Period Mapping
7.Category Mapping: If category exist under category list which you want to load into target dimension
than select it or otherwise create them.

Setup - Integration Setup Category Mapping

For creating New click on add provide source system data to Target Scenario dimension member.

Data Load: In this Part of FDMEE We will see process of Data Load and validation of data and finally how
we export data from ERP to EPM system.
Data Load
8.Data Load Mapping

Workflow-Setup - Data Load -- Data Load Mapping

Than In workflow we set Data Load Mapping. for members like Market, Product, Scenario we map
simply without script with like mapping all source goes to all target. but for Measures we write script, so
that all source mapped with target based on conditional mapping.

We write #SCRIPT keyword for Jython script in place of Target value and #SQL for sql scripts.

WorkflowData Load Mapping-select Measures


When we write #SCRIPT in Target value script editor will be enabled for us here we write script, this is
recommended that first write script in notepad than copy it and paste into script editor. then save it.

This is our script

fdmRow is used to get column value of current row in our script our column name is Account .so when
mapping is processed it return column value.

fdmResult returns the updated value for the target dimension. If amount less than zero than it return
IGNORE or else it return amount to the function.

Map all remaining dimensions.

Dimension- Measures

Here we also write script for Measures.


Dimension- Market

Dimension- Product

9.we need to set Data Load Mapping. but first select POV (Point of view).
10.Data Load Rule: We need to create data Load rule for location and category to describe what we are
going to import from ERP system. For prepare Data Load Rule click on plus icon Fill all the details like
provide any suitable Name to your Data Load Rule, Choose File Type here we are loading data for single
period. Than choose Import Format which you Prepared.

After that in Source Option select File Name Which you want to Load.

Workflow -- Data Load - Data Load Rule

11.Data Load Workbench


Here we can see our data successfully Loaded.
We can see in Target Measures “IGNORE” loaded for amount -20 because it is less than Zero. For
other sales loaded.

Excel output

See in California there is no data loaded because amount was less than zero.

Problem 4: In my File Measures dimension contain dimension member with some appended text, here
we need to eliminate appended text so that only dimension member will be loaded into Target
application. For ex file contains sales_10 in measures dimension, so we need to eliminate -10 through
Import Script.

Expected output: sales from sales-10.

Target Application: Sample-Basic

File Name: Removeextra.txt


Script Type: Import Script

Ex. Step by step process of writing Import Script: -

1.In First step we login to workspace and open FDMEE.

Navigate -Administer -- Data Management

2.Go to setup tab Register Source system.

SetupRegister-source system
Here you can see File (source system) is registered already.

If you want to register any other source simply click on plus icon and you can add here.

For add new Source system: SetupRegister-source system-add

Provide name for source system, select source system likewise fill other details than save it.

3.Go to setup tab Register Target Application.

SetupRegister-Target Application

Here you can see some of the Target application is registered already. My Target Application name is
sample-Basic

If you want to register any other Target, simply click on plus icon and you can add here.

For add new Target application.

SetupRegister- Target application -add

Click on add than window will appear, from dropdown select Type of Target application, then Name of
application will appear select one of them click on ok.
Here you can see all the details comes automatically related to dimension mapping this refers to staging
table. Market, Product, Scenario are generic dimension and Measures is Account Type and Year is Period
dimension. You can view in detail in your Target application by seeing dimension type.

4.Now in next step define import format here we define map to source. We also define script in Import
format.

Setup - Integration Setup


Setup - Integration Setup Import Format

If Import format not present in list than add it by click on add button you will have option below to add
new import format fill all the details like Name of import format than source Type, Source File etc. File
Type Delimited means your source file contains which type of delimiter in my case it is comma. Click on
save than need to define Mapping Type.

Here define Mapping based in your source File provide Source column name than Field Number of
source.
5.Now we write script.

Setup-Scripts--Script Editor---Import

Here select your Target Application as Sample-Basic, and Technology as Jython.

For creating new script.

Setup-Scripts--Script Editor---Import---New

Script Name and definition of function should be exactly same. Function takes two parameters field
name, record Name. FDMEE takes data as series of characters from file and character index starts from
zero. Now we need to identify in our source file from where we need to start and what will be the end
point we need to read characters, like in our case sales index is sales [0:5], rest of the character of this
dimension we need to ignore. It represents range of character, it takes sales_10 as input and return
sales.
Script

Now we give reference of this script into Import Format. this script we written for Measures dimension
so, click on Measures and you can see pencil Icon under add expression over their click on it. choose
Expression Type as script. Than select Expression value. Click ok, then save it.

6.Location: Once we define Import Format define Location Here if location not available in list than click
on add button and fill related details.

Setup - Integration Setup Location


To Specify new Location, give any name to Location provide Import Format Name which you gave in
last step once you provide Import format system automatically fetch all other details related to source
and Target. Then click on save.

7. Period Mapping: suppose we want to load data for Jan 2016 so we can specify this into Period
mapping. Period mapping is used to map source data(File) to Target dimension which is period
dimension(Sample-Basic). we can define mapping at different levels like Global, Application, source
system.

Setup - Integration Setup Period Mapping


8.Category Mapping: If category exist under category list which you want to load into target dimension
than select it or otherwise create them.

Setup - Integration Setup Period Mapping

For creating New click on add provide source system data to Target Scenario dimension member.

9.we need to set Data Load Mapping. but first select POV(Point of view).

Data Load: In this Part of FDMEE We will see process of Data Load and validation of data and finally how
we export data from ERP to EPM system
Data Load
Data Load Mapping: We use Data Load Mapping for map source dimension member to their target
Application Dimension member. We have Location, Period, Category set of Mappings for Data Load
Mapping. For that we need to select for which member we want to load data like in my case I choose
Product as a dimension than we have types of Mapping choose one of them then click on add then fill all
details. We need to specify mapping for each dimension.

Setup - Data Load -- Data Load Mapping

Dimension- Product

Dimension- Scenario

Dimension- Market
Dimension- Measures

10.Data Load Rule: We need to create data Load rule for location and category to describe what we are
going to import from ERP system. For prepare Data Load Rule click on plus icon Fill all the details like
provide any suitable Name to your Data Load Rule, Choose File Type here we are loading data for single
period. Than choose Import Format which you Prepared.

After that in Source Option select File Name Which you want to Load.

Workflow -- Data Load - Data Load Rule


Basically, data load rule represents our file which we want to import with other details once we
complete data load rule we need to save it so execute button enabled than click on it here Execute
rule window will appear here we need to specify one or more periods. Run it than you will see one
process id has created than verify it by click on save

11.Data Load Workbench


Here we can see our data successfully Loaded.
We can see in Target measures sales appended value has eliminated.

Workbench Output
Excel Output

You might also like