Oracle Hyperion Financial Data Quality Management, Enterprise Edition (FDMEE) allows the use of scripting in several locations:
- Import
- Event
- Custom
- Mapping
Scripting allows you to work with the incoming data fields and strings to modify them as needed before the data is processed. Use of scripting at different points will allow you to take a more complete control of the data you are processing. This is not always required but when it is it can be very useful.
Let’s take a look at Import scripting today. Import scripting is used in the Import Format to manipulate incoming data. This data is presented to the script in 2 strings are in the variables strField and strRecord. The value in strField is the string that in is the defined column used by the import format. The value in strRecord is the entire record or row being processed by the Import Format.
In the following example, Entity uses an Import Script called Get_Entity.py
Import Scripts are stored in the Application Root Folder
In this case, the scripts will be saved into the directory D:\FDMData\PlanBud\Data\scripts\import
Common Jython String Manipulation Functions
Jython comes with a very robust set of functions to handle strings. The following list contains some of the most common functions:
Jython starts counting Characters at 0 rather than 1. We call that being Zero Relative.
Extract Beginning Characters
Get the first 4 characters of strField
- def Parse_Account (strField, strRecord):
- return strField[:4]
Based on the following file:
The return would be “03_0” for line one.
Extract Middle Characters
Get the 6th through the 10 characters
- def Parse_Account (strField, strRecord):
- return strField[6:10]
The return would be “1010” for line one.
Extracting the End of the String
Get the last 4 characters of the Account field
- def Parse_Account (strField, strRecord):
- return strField [-4:]
The return would be “03_0” for line one.
Use the Split Function
Split the string by the underscore character “_”.
- def Parse_Account (strField, strRecord):
- seglist = strfield.split(“-“)
- return seglist[0]
The return would be “03” for line one. If you wanted the second set of characters “00” you would just change the value for the return to “seglist[1]”.
upper()
Convert the string into all upper case characters.
- def Parse_Description(strField, strRecord):
- return strField.upper
The return would be “SALES DISCOUNT” for line one.
lower()
Convert the string into all lower case characters.
- def Parse_Description(strField, strRecord):
- return strField.lower
The return would be “sales discount” for line one.
replace()
Replace text values found in the string with new values specified.
- def Parse_Description(strField, strRecord):
- return strField.replace(“BOB”,”Big Orange Ball”
The return would be “Big Orange Ball” for the line six description.
concatenation
Concatenate several string values and return the result.
- def Parse_Account (strField, strRecord):
- seglist = strfield.split(“-“)
- return seglist[0] + seglist[1] + seglist[2]
The return would be “00031010” for line one.
These string manipulations are some of the more common ones used with FDMEE and Import scripts. In my next blog we will dive into more FDMEE scripting.