Let us quickly see the types of the load rules file: • Flat file load rule: As explained earlier in this chapter, and will be demonstrated shortly, probably the most common method of lo
Trang 17 Finally, you can accept the default output for the log which will be generated
by the data load or you can type a new path
8 Click OK to load your data There you have it! You have just loaded data
without a rules file
Structured data load (load rule used)
In Essbase, you can create a load rule file to load data into an Essbase cube In this
rule file, you need to define the data source This data source can be a flat file or an
SQL query, you can also write the queries in the load rule Using the rule file, you
can cleanse the data before it gets loaded into the cube Let us quickly see the types
of the load rules file:
• Flat file load rule: As explained earlier in this chapter, and will be
demonstrated shortly, probably the most common method of loading data
into your Essbase database is by a data flat file and Essbase data load rule
method Inside the data load rule, you define to Essbase what fields in the data file relate to what dimensions in the database outline The database load rule
is also where you can perform data transformations, data substitutions, data
manipulations, or pretty much any other task you need to perform to get your data Essbase-friendly Then either manually or automatically, you perform
a data load into your Essbase database using the data file and the load rule
created for it
• Relational database SQL load rule: This data load method is essentially
identical to the flat file load rule method, except for one huge difference
Instead of the input data contained in the form of a flat file, the data is
being selected directly from a relational database's table or tables Real SQL statements are used and an ODBC connection is used behind the scenes by
the load rule to connect to the relational database After this, the creation
of the load rule is identical to the flat file method when it pertains to data
handling, and so on
Microsoft Excel Lock and Send (no load rule)
This method is perhaps the quickest, down and dirty, method of loading data into
an Essbase database While it is fast and easy, there are limitations and precautions Since Microsoft Excel is the natural front end for Oracle Essbase, they do work rather seamlessly together However, you do need to remember, that what you are doing
with a spreadsheet's "Lock and Send" function is updating existing data as there are
no provisions for adding new members to the database outline through Microsoft
Excel Also, Essbase seems to have difficulty locking too many data cells when asked
by Microsoft Excel Due to performance issues, you may want to consider splitting
Trang 2As this is typically how the business users will update the data, it is a more than
acceptable method This method is also ideal for tweaking specific data values prior
to calculation
Finally, this method is ideal for data validation when writing and executing new
Essbase calculation scripts You can retrieve data into your spreadsheet, execute
your Essbase calculation script, and retrieve the data into another sheet to compare
the changes If the results are not what you expected, then simply "Lock and Send"
the data in the first sheet back to the database, make adjustments to the calculation
script, and run it again, then retrieve the data once more to validate The "Lock and Send" method is explained in detail in the later chapters
That was easy!
Building your first data load rules file
Actually, we should have said build your second data load rule file, as we have built one rules file already The first one you built, in the previous chapter, is a dimension build rules file Now, in this chapter, we are discussing how to load data into your
Essbase cube so this is a data load rules file
In the previous section, we talked about how to load data without a data load rules file We will now learn how to cleanse the data, make the data Essbase-friendly and then load the data into the Essbase using an Essbase data load rules file
Once you have created a data load rules file, just like the dimension build rules
file, you can use it to manually load the data from the EAS or use EssCmd or MaxL
(Essbase scripting languages), to load the data into your Essbase database You
can even write your own program that makes its own API call to load the data
into Essbase
Here are some of the advantages of using the data load rules files:
• Makes the data Essbase-friendly
• Ignores the data fields that do not need to be loaded into Essbase
• Specifies whether to overwrite the existing data, add to existing data,
or subtract from existing data
• Trims out spaces
• Changes the scaling of decimal numbers
• Converts case from upper to lower and vice versa
• And much more
Trang 3Next, we take you through the steps required to create a rules file you will use to
load data into your Essbase database Always remember, no matter how you load
the data, through EAS, EssCmd or MaxL, or programmatically, you will always use the same rules file in your load process That's simple and convenient!
Step 1: Starting the Data Prep Editor
Follow the given steps to start the Data Prep Editor:
1 In EAS, click on the File menu pick.
2 Select Editors and click on the Data Prep Editor, or click on New, and from the New dialog click the Scripts tab and select Rules File, then click on OK.
3 The Data Prep Editor will open as shown in the following screenshot.
4 Once the Data Prep Editor is opened, the menu items in EAS will change.
Step 2: Associating the data load rules file
In order for you to successfully validate the rules file to the database and outline
for which it is intended, you will need to associate the rules file to the correct
database outline This association of the rules file to the database outline is saved
the first time However, Essbase will ask you to associate the rules file again to the
proper database outline every time you reopen this rules file You do not need to
re-associate the database outline if you do not wish to as the rules file will remember the initial association
Trang 4To associate your data load rules file to a database outline:
1 Again, using EAS, open the Data Prep Editor
2 Click on Options | Associate Outline or click on the Associate button
in the Data Prep Editor.
data source file
The source data which needs to be loaded into the Essbase cube can be a data file
(Comma separated files like a txt file, or a dat file) or a relational database which can be retrieved using the relational databases own SQL statements The following
screenshot shows the Esscar data in the relational database system (Oracle):
To open a data source file or SQL data source:
1 In EAS, open the Data Prep Editor.
2 Once you've clicked on File you should see the options Open Data File
or Open SQL.
In the previous chapter, you saw how to use the Data File In this chapter,
we will see how we can achieve the same thing using the SQL data source:
1 Click on the Open SQL selection.
2 A new window will open asking you to select the Server name, Application
name, and Database name Please select the appropriate names and click OK.
Trang 53 You will see the Open SQL Data Sources window as shown in the
following screenshot:
As shown in the previous screenshot, you can write your own SQL query However, you are somewhat limited to what you can write Here is how to write your own
SQL query:
This is a great feature for writing most queries, but if you are unable to write any particularly complex queries, you can always create an Essbase temporary table in your relational database that contains everything you need (data values, columns, and so on)
Then, your data load rule SQL statement only needs to be a simple SELECT <column names> FROM, WHERE…
2 Write your query and click on Retrieve.
3 Enter the SQL user ID and password and click on OK and you should
see the data populated as shown here: