Loading Data into Essbase [ 130 ] 7. 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 le. Structured data load (load rule used) In Essbase, you can create a load rule le to load data into an Essbase cube. In this rule le, you need to dene the data source. This data source can be a at le or an SQL query, you can also write the queries in the load rule. Using the rule le, you can cleanse the data before it gets loaded into the cube. Let us quickly see the types of the load rules le: • Flat le 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 at le and Essbase data load rule method. Inside the data load rule, you dene to Essbase what elds in the data le 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 le and the load rule created for it. • Relational database SQL load rule: This data load method is essentially identical to the at le load rule method, except for one huge difference. Instead of the input data contained in the form of a at le, 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 at le 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 difculty locking too many data cells when asked by Microsoft Excel. Due to performance issues, you may want to consider splitting spreadsheets that contain a considerable amount of rows. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Chapter 4 [ 131 ] As 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 specic 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 rst 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 rst data load rules le Actually, we should have said build your second data load rule le, as we have built one rules le already. The rst one you built, in the previous chapter, is a dimension build rules le. Now, in this chapter, we are discussing how to load data into your Essbase cube so this is a data load rules le. In the previous section, we talked about how to load data without a data load rules le. 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 le. Once you have created a data load rules le, just like the dimension build rules le, 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 les: • Makes the data Essbase-friendly • Ignores the data elds that do not need to be loaded into Essbase • Species 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 This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Loading Data into Essbase [ 132 ] Next, we take you through the steps required to create a rules le 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 le 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 le In order for you to successfully validate the rules le to the database and outline for which it is intended, you will need to associate the rules le to the correct database outline. This association of the rules le to the database outline is saved the rst time. However, Essbase will ask you to associate the rules le again to the proper database outline every time you reopen this rules le. You do not need to re-associate the database outline if you do not wish to as the rules le will remember the initial association. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Chapter 4 [ 133 ] To associate your data load rules le 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. Step 3: Opening data load le or the SQL data source le The source data which needs to be loaded into the Essbase cube can be a data le (Comma separated les like a .txt le, or a .dat le) 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 le 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. This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com Loading Data into Essbase [ 134 ] 3. 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: 1. SELECT, FROM, and WHERE are already declared. 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: This material is copyright and is licensed for the sole use by Paul Corcorran on 5th July 2009 8601 ave. p #1, , lubbock, , 79423 Download at Boykma.Com . common method of loading data into your Essbase database is by a data at le and Essbase data load rule method. Inside the data load rule, you dene to Essbase what elds in the data le relate. 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. le. 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 le. Once you have created a data load