BI & Warehousing

Time Dimensions with Hourly Time Periods

Keith Laker - Thu, 2010-05-06 08:26
I was working on an application last week that required time series analysis at Hour, Day, Month, Quarter and Year levels. Two interesting things came out of this application.

First, a little implementation detail. The data was supplied in the fact and dimension tables at the Hour level with a TIMESTAMP data type. As you might expect then, there were time periods at the hour level such as:

02-JAN-10 10.00.00.000000000 AM
02-JAN-10 11.00.00.000000000 AM
02-JAN-10 12.00.00.000000000 PM
02-JAN-10 01.00.00.000000000 PM
02-JAN-10 02.00.00.000000000 PM

In my first attempt at building the time dimension I loaded hours directly from TIMESTAMP data type. In that case, the members at Hour level were loaded into the dimension stripped of the hour (e.g., 02-JAN-10). Since this isn't what I wanted, I converted the hours into a CHAR as follows:

CREATE VIEW time_dim_view AS
SELECT
TO_CHAR(hour_id, 'DD-MON-YYYY HH24') AS hour_id,
TO_CHAR(hour_id, 'DD-MON-YYYY HH24') AS hour_desc,
hour_time_span,
hour_id AS hour_end_date,
.. and so on.

This gave me dimension members at hour as follows:

01-JAN-2010 00
01-JAN-2010 01
01-JAN-2010 02
01-JAN-2010 03
01-JAN-2010 04

That worked just fine. I did the same for the descriptions (so that they would be more easily readable by end users) and added a corresponding column to a fact view so that the time view and fact view joined correctly on the TO_CHAR(...) columns.

For the TIME SPAN attribute, I used a fractional value of DAY (0.041667, which is 1/24th of a day). I read the DATETIME into the END DATE attribute as is (no conversion required). From there on, everything worked perfectly (cube builds, time series calculations, etc).

If you happen to look at the END DATE attribute from the OLAP DML side, be sure to wrap the END_DATE object in a TO_CHAR function so that you see the hours. Otherwise, you will see only the day in most cases (it depends on the NLS_DATE_FORMAT setting for the session). For example:

REPORT DOWN TIME TO_CHAR(TIME_END_DATE 'DD_MON_YYYY HH24')

The other thing that was interesting has more to do with the application design. As so often happens, the customer was inclined to build one cube with all history at the hour level (two years of history). When examining the reporting requirements, however, it turned out that hour level analysis very rarely occurs more than 2 month back. Almost all of the reporting looking back over the two years was at the day level or higher (that is, not hourly level reporting).

We could have built the one cube (two years, hour and higher), but most of the processing of hour level data would have been a waste because users don't look at the older data at that level. Instead, we built a very efficient application with two cubes. One cube contained only three months of data at the hour, day, month, quarter and year levels. Another cube contained two years of history starting at the day level.

Presentation of the data is mostly done using Oracle Business Intelligence Enterprise Edition(via SQL to the cube). Some reports examine hourly level data. Other reports examine more aggregate data over longer time periods. Time series calculations (e.g., period to date, moving average, etc.) were added to both cubes and made available in the OBIEE reports.

Occasionally, a user will want to drill from day to hour more than three months back. To support this, OBIEE was set up to drill from day (in the two year cube) to hour in the fact table. The only compromise was that the time series calculations of the cube were not available when drilling to hour in the fact table. That didn't matter to these users.

From the end user perspective, the fact that there were two cubes instead of one (as well as a fact table) was completely irrelevant since OBIEE presented all data in reports in a single dashboard. From a processing perspective, the system was much more efficient and manageable as compared to the single big cube approach.

It is very worthwhile to keep this lesson in mind when you design your applications. Pay careful attention to reporting requirements and build cubes that meet those requirements. You can tie multiple cubes together in a tool such as OBIEE. This approach is often much better then building a single cube every level of detail.

In this case, the example is about what level of detail is in which cube. The same concept applies to dimensions. You might find it much more efficient to build Cube 1 with dimensions A, B, C and D and Cube 2 with dimensions A, B, E and F rather than one big cube with all dimensions.
Categories: BI & Warehousing

Parallel Execution of OLAP DML

Keith Laker - Tue, 2010-03-16 13:44
While I was teaching a workshop in Moscow recently a student asked about parallel execution of OLAP DML. Their cube processing included the usual loading and aggregation, which are automatically parallelized, but they also have some assignments into the cube which are done using an OLAP DML program. They noted that this was slow because it was single threaded on one CPU. I told the student that Oracle OLAP supports a multi-write attach mode that can be used to update multiple objects in parallel using separate sessions. I checked the documentation, but didn't find a clear explanation of how this works in the context of processing partitions of a cube in parallel.

Here's a code sample that illustrates how to process partitions of a cube in parallel. For this example, assume that the cube has four dimensions: time, product, geography and channel. The cube is partitioned on the time dimension at the retail year level. An OLAP DML program is used to assign data into the cube at the day level (it will be aggregated later).

" Attach the AW
AW ATTACH global_business multi

" Set status of time to match the partition. In this example, the partition is 'P3'
LIMIT time TO PARTITION(sales_prt_template) EQ 'P3'

" Keep data at the day level.
LIMIT time KEEP time_levelrel 'DAY'

" Set status of other dimensions.
LIMIT product TO product_levelrel 'ITEM'
LIMIT geography TO geography_levelrel 'STATE_PROVINCE'
LIMIT store TO store_levelrel 'STORE'

" Acquire the partition for write.
ACQUIRE RESYNC sales_stored_stored (PARTITION p3)

" OLAP DML assignments.
sales_stored(sales_measure_dim 'DOLLAR_SALES') = sales_stored(sales_measure_dim 'QUANTITY') * price_stored(price_measure_dim 'PRICE') across sales_stored_prt_template

" Update and commit to save work.
UPDATE multi
COMMIT

" Release the partition.
RELEASE sales_stored (partition p3)

" Detach the AW
AW DETACH global_business


The important points are:
  • The attach mode is MULTI
  • Use ACQUIRE to attach the appropriate partition.
  • The PARTITION function can be used to set status of the partitioned dimension to the dimension members in the partition.
  • Use the MULTI keyword with UPDATE.
  • RELEASE the partition.
  • While it doesn't have anything to do with running this in parallel, "across sales_stored_prt_template" will cause the OLAP DML to loop the local composite index of the partition rather than loop over the base dimensions.

Repeat this code (or use parameters) for each partition. To run in parallel, run these commands in seperate database sessions for each partition. The above code sample is pure OLAP DML. In practice, it makes sense to execute this in the context of PL/SQL that you can call in separate SQL Plus sessions. E.g.,

BEGIN

-- Attach the AW in multi-write model.
dbms_aw.execute('AW ATTACH global_business multi');

-- Set status of time to match the partition.
dbms_aw.execute('LIMIT time TO PARTITION sales_prt_template) EQ ''P1''');
dbms_aw.execute('LIMIT time KEEP time_levelrel ''DAY''');

-- Set status of other dimensions.
dbms_aw.execute('LIMIT product TO product_levelrel ''ITEM''');
dbms_aw.execute('LIMIT geography TO geography_levelrel ''STATE_PROVINCE''');
dbms_aw.execute('LIMIT store TO store_levelrel ''STORE''');

-- Aquire the partition for write.
dbms_aw.execute('ACQUIRE RESYNC sales_stored_stored (PARTITION p1)');

-- OLAP DML assigment.
dbms_aw.execute('sales_stored(sales_measure_dim ''DOLLAR_SALES'') = sales_stored(sales_measure_dim ''QUANTITY'') * price_stored(price_measure_dim ''PRICE'') across sales_prt_template');

-- Update to save work.
dbms_aw.execute('UPDATE multi');

-- Release the partition.
dbms_aw.execute('RELEASE sales_stored_stored (partition p1)');

-- Detach the AW
dbms_aw.execute('AW DETACH global_business');

END;
/

COMMIT;

If this is done with PL/SQL, then you can run a shell script such as this to run all partitions in parallel.

sqlplus olaptrain/***** @set_sales_cost_p1.sql &
sqlplus olaptrain/***** @set_sales_cost_p2.sql &
sqlplus olaptrain/***** @set_sales_cost_p3.sql &
sqlplus olaptrain/***** @set_sales_cost_p4.sql &

Categories: BI & Warehousing

Excel and Oracle OLAP - Reporting No-Agg Measures

Keith Laker - Tue, 2010-02-23 08:41
I've run into this a few times recently, so here's a quick tip related to using Excel with Oracle OLAP (via the Simba MDX Provider for Oracle OLAP, of course).

Here's a situation that's been reported as a bug, but you really just need to know the right Excel Pivot Table option to choose. Consider a cube that has measures that do not aggregate but is dimensioned by a dimension with a hierarchy. In this case, there is a cube with a Store dimension with levels Store > Store Type > All Stores. The stores are located in different countries and sell in local currencies. There is a Local Currency measure, with sales reported in whatever the local currencies might be (Euros, Dollars, Yen, etc.) and a Dollar Sales measure with the U.S. Dollar conversation. As a common currency, Dollars can be aggregated. Local currencies can't be aggregated.

Here's a sample report in Excel.



Note that Dollar Sales is reported for Direct and Indirect but Local Sales is not. That's correct because Local Sales doesn't aggregate.

But what if I happen to select only Local Sales (which is null at the aggregate members Direct and Indirect). By default, Excel will display the report as shown below.



This isn't very useful because I can't drill down on the Direct member to get at the stores. The solution is simple, but a lot of people seem to miss it. Just choose the Show items with no data in rows PivotTable option.



Now you will be able to see the Direct and Indirect members, allowing you to drill to stores.



Now, after the drill.

Categories: BI & Warehousing

Funny YouTube Video Featuring Oracle Data Mining

Marcos Campos - Thu, 2010-02-18 12:08
Maybe I am too much of a data mining geek, but I found the video below to be funny. It also talks about a super cool feature ODM introduced in 11.2: the ability of scoring data mining models at the disk controller level in Exadata. This is a significant performance booster. It also makes it feasible to produce actionable insights from massive amounts of data extremely fast. More on this on a Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com1
Categories: BI & Warehousing

Oracle Data Mining Races with America's Cup

Marcos Campos - Thu, 2010-02-18 11:57
For those that have not heard the BMW Oracle Racing team won the America's Cup sailing an incredible new boat. What even those that have been following the news on the race do not know is that Oracle Data Mining helped the performance team tune the boat. I participated helping with that problem and it was a very hard one: Imagine standing under an avalanche of data - 2500 variables, 10 times Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com0
Categories: BI & Warehousing

Time for a Change – Upcoming Announcements – Millionth Hit

Venkat Akrishnan - Mon, 2009-06-15 12:35

Well, as the saying goes “Change is the only Constant”, there are quite a few changes that are coming up on this blog(well not blog alone!!!) in the near future. I would be in a position to make an announcement in a week or so. And i am very much looking forward to that. One thing that i can say for sure is the fact that you can expect more of my blog entries in the future:-). More on that next week.

And as luck would have it, while i was writing this, the blog registered its first Millionth hit (of a total of 302 blog entries). I would have to express and extend my thanks to anyone and everyone who have been visiting this blog ever since its inception on 18th of July 2007. I believe the blog has come a long way since then. I have written at least two blog entries every week since i started, barring a couple of months when i did not even write a single one. When i started to write on BI EE there were only a couple of people writing about it like Mark(who was very well known in the Oracle BI Community even at that time) and Adrian(actually myself and Adrian were discussing this in the BI Forum). Then came along John who was also very active on the BI Forums. And then came people like Alex(Siebel + BI EE) , Christian (BI EE + Essbase) and others who have been working on these products for long but just now started to blog about them.

In the coming future, i would be primarily focusing on Hyperion Essbase(i would say this has been a tool that has been really close to my heart that i have not blogged much about), EPM Integration, Hyperion Planning/EPMA integration, BI EE – Essbase Integration (more use cases). Hopefully you have found this blog useful and thanks for stopping by.


Categories: BI & Warehousing

Oracle Data Integrator 10.1.3.5 – Connectivity to Open LDAP of Shared Services

Venkat Akrishnan - Tue, 2009-06-09 15:32

One of the features of Oracle Data Integrator is its ability to connect to a lot of disparate data sources using JDBC. One such feature is its ability to expose any LDAP directory as a relational source. If you are on earlier releases of Hyperion EPM like 9.3, where there is no out of the box SSO and authentication/authorization capability to BI EE with open LDAP, one approach is to configure BI EE to authenticate against OpenLDAP and then get the user-group information from some other custom table(or by using the DBMS_LDAP package). I had shown how to configure BI EE to authenticate against OpenLDAP here. Since BI EE cannot automatically pick up the groups directly from OpenLDAP in prior releases, one way is to get the user-group related information from OpenLDAP and then populate that into a set of custom tables. Then BI EE can be used to get these groups from the custom tables. The architecture would look something like this

image

Lets look at what it takes to setup the OpenLDAP connectivity from ODI. As a first step lets first log into Topology Manager and create a new LDAP connection. Choose the “Sunopsis JDBC Driver for LDAP” as the JDBC driver

image

And then choose the JDBC URL.

image

To enable the connectivity to any LDAP directory, the password would have to be passed in an encoded format. To encode the password, run the below command from a command prompt.

 
java -cp {OracleDI}\oracledi\drivers\snpsldapo.jar 
com.sunopsis.ldap.jdbc.driver.SnpsLdapEncoder
<the of password root openldap>

image

Copy the above encoded password. In the JDBC URL, enter the below URL

 
jdbc:snps:ldap?ldap_url=ldap://localhost:28089/ &amp;ldap_password=KILAKMNJKKLHKJJJDDGPGPDB
&amp;ldap_basedn=dc=css,dc=Hyperion,dc=com 

image

The basedn above is what would be used for searching all the users, groups, roles etc. In the Data Server definition, enter the username as root user who has traversing access to the entire OpenLDAP directory

image

You should be able to test the connection to the LDAP from here. The root user of OpenLDAP is different from the admin user. In fact, the admin user’s original cn is not admin. It is 911. admin is the givenName attribute of the 911 user. The root user password is by default root. One behavior that i noticed across the releases, was the fact that in 9.3 release admin user had the traverse directory privilege. But in EPM 11, 911 user does not have the traverse directory privilege. In my case, the default root password did not work. So, i had to reset the root user password from shared services.

image

As a side note, if you feel that shared services web console does not give you the actual LDAP directory structure, i would recommend a free LDAP client like JXplorer. The screenshot of shared services OpenLDAP using this free client is given below

image

Now, if you go to the Designer and reverse engineer this data source using selective reverse.

image

image

This should convert the entire directory structure to a relational format. From this point onwards, its a matter of building the interfaces and loading the custom user-group tables. Though the setup of the above is pretty straight forward, this can come in very handy especially when you are trying to consolidate/report against multiple user sources.


Categories: BI & Warehousing

Oracle Data Integrator 10.1.3.5 – Using OBI EE as a Data Source – Using BI EE JDBC Driver

Venkat Akrishnan - Sun, 2009-06-07 06:33

In a prior blog entry here, i had shown how to use BI Server as a data source for loading data from Essbase into custom tables. That approach basically used the Sun ODBC-JDBC bridge which in most cases has bad performance. Today we shall see how to use the native BI Server JDBC driver to connect to BI Server and in-turn use that for loading Essbase Data into a custom table.

One of the major advantages of ODI is the fact that it can be used to connect to any data source that has a valid jdbc driver. In order to make ODI to use the BI EE JDBC driver, we need to make the JDBC driver (jar file) of the BI Server to be accessible by ODI. The jar file(bijdbc14.jar) of BI Server can be obtained from the BI Publisher web server installation folder {OracleBI}\oc4j_bi\j2ee\home\applications\xmlpserver\xmlpserver\WEB-INF\lib. The main reason why we are going to the BIP folder structure is because BIP uses the JDBC driver of BI Server to do reporting on BI EE metadata.

image

The above screenshot basically provides the database driver class and the connection string of the JDBC driver of BI EE. Now copy this driver jar file to {OracleDI}\oracledi\drivers directory.

image

Now open up Topology Manager and create a new Universal Data Server. Use the above driver class and connection in the JDBC URLs.

image

Ensure that you are able to test the connection using Administrator username and password.

image

Now, in the physical schema choose any subject area in the Presentation Layer.

image

Now once this is done, go to the Designer and create a Project. And import the necessary Knowledge Modules that i had shown in the last blog entry. Since we are using JDBC, we can do a selective reverse of all the necessary tables.

image

But be aware that, BI EE supports multiple presentation tables with the same name across subject areas. But ODI currently does not support multiple table import with the same name (as there is no BI EE specific RKM. This can be resolved if you build a separate RKM. Also, though you might be able to reverse objects with special characters, they would not work within an Interface. So, its better to create aliases with proper ODI supported naming conventions. ). Lets choose just 4 such tables, Basic, Market, Scenario and Year.

image

image

image

Now lets build a very simple interface wherein we would be inserting Gen2, Market and the Measure value into a dummy table. Remember in BI EE, whenever you are bringing in multiple tables from a single presentation subject area, no joins are needed i.e. a cross join would have to be configured across multiple tables.

image

If you execute this interface you would notice that BI Server would generate the MDX accordingly and would then insert the output of the MDX to the database table.

image 

This should give you an idea of how to go about using multiple BI EE subject area tables in an ODI interface and then using that interface to load data into a database table. Also, this method should typically be as fast as your BI Server is since it uses the JDBC connectivity as opposed to the JDBC-ODBC bridge.


Categories: BI & Warehousing

Oracle BI EE 10.1.3.4.1 – Handling Complex String Manipulations – Using Regular Expressions (RegEx) and Evaluate

Venkat Akrishnan - Thu, 2009-06-04 05:05

One of the requirements that i recently came across involved some complex string manipulations that cannot be solved easily by using BI EE specific functions. Just to illustrate the requirement, take a look at the screenshot below

image

As you see, the above is a simple BI EE report containing the customer related details. But the major problem with this report is that, it contains all the details of a customer in a comma separated  format. Basically the source application has inserted the data into this table in such a fashion. One key aspect to this is the fact that the comma delimited customer details follow a specific pattern. That is the details column is nothing but a concatenation of the below customer attributes in the same order

1. Customer First Name
2. Customer Last Name
3. Customer Gender
4. Customer Email Address
5. Customer Phone Number
6. Customer Street Address
7. Customer City
8. Customer State
9. Customer Country

The requirement is to get a report containing the Customer ID, Country ID, Customer Phone Number and the Customer Email address. Normally the best place for handling this would be in the ETL stage wherein individual attributes can be split into multiple columns and then used for reporting. Unfortunately in most cases we would have to work with what we have. To do this in the reporting layer requires some complex INSTR, SUBSTR logic. Today we shall another approach for handling such requirements. Instead of using normal string manipulation functions, we shall be using a new feature of Oracle 10g called as the Regular Expressions.

Regular Expressions or RegEx make string manipulations easy and in fact provides quite a few advanced formatting, filtering options. The regular expressions come as 4 different types of functions

1. REGEXP_SUBSTR – Advanced Sub-String function
2. REGEXP_INSTR – Advanced String position evaluation function
3. REGEXP_LIKE – For doing advanced filtering on a result set
4. REGEXP_REPLACE – For doing advanced multiple-iterative string replace

In order to achieve the above requirement, we need to use these database functions. And of course, we need to use EVALUATE to call these database functions. To split the above comma separate customer attributes, we need to use RegEx functions given below

1. Customer Phone – REGEXP_REPLACE(CUSTOMER_DETAILS,'(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)’,’\4′)
2. Customer Email – REGEXP_REPLACE(CUSTOMER_DETAILS,'(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*)’,’\3′)

Now use EVALUATE and pass down the above RegEx functions back to the database.

image

If you look at the report now, you should basically have the individual attributes in a separate column as shown below.

image

The above was one requirement. Lets look at another requirement now. In some cases, when you are reporting against transactional applications, you would have columns which get entered as free flowing text. The requirement is to classify these columns into 3 types. One is numeric, the other is free text without numbers and the third is alphanumeric. The requirement is to basically give a provision to the end users to choose a specific type and then that column should only the corresponding text i.e. for example if numeric is chosen only the text where numbers were entered should be displayed. In normal sql terms, filtering for numerals and alpha-numerals require separate logic and is complicated as well. We shall see how we can achieve this using RegEx.

Lets first take a look at the report

image

Now, lets create a prompt which will produce just 3 values (Numeric, Alphabets, Alpha-Numeric).

image

 
SELECT 'Numeric' FROM RegEx WHERE CUSTOMERS_DETAILS.COMMENTS IS NOT NULL 
UNION ALL 
SELECT 'Alphabets' FROM RegEx WHERE CUSTOMERS_DETAILS.COMMENTS IS NOT NULL 
UNION ALL 
SELECT 'Alpha-Numeric' FROM RegEx WHERE CUSTOMERS_DETAILS.COMMENTS IS NOT NULL 

Make this prompt to set a presentation variable called AlphaNum.

image

Now go to the original report and create a filter as shown below

 
CASE WHEN '@{AlphaNum}{Numeric}' = 'Numeric' 
THEN EVALUATE('REGEXP_SUBSTR(%1,''^\d+$'')',CUSTOMERS_DETAILS.COMMENTS) 
WHEN '@{AlphaNum}{Numeric}' = 'Alphabets' 
THEN EVALUATE('REGEXP_SUBSTR(%1,''^[a-zA-Z]+$'')',CUSTOMERS_DETAILS.COMMENTS) 
ELSE EVALUATE('REGEXP_SUBSTR(%1,''^[a-zA-Z0-9]+$'')',CUSTOMERS_DETAILS.COMMENTS) END IS NOT NULL 

image

Now include this report in the main dashboard along with the prompt.

image

image

As you see, the RegEx functions are pretty powerful. And of course, with the advent of EVALUATE, we now have the capability to leverage them from BI EE itself. This saves time and effort in implementing complex string based logics.


Categories: BI & Warehousing

Oracle Data Integrator 10.1.3.5 – Using Oracle BI EE as a Data Source – Loading Essbase data into custom tables – Using JDBC-ODBC Bridge

Venkat Akrishnan - Tue, 2009-06-02 03:23

In the blog entry here, i had basically shown multiple ways of loading data into Essbase. Today we shall see an approach wherein one can extract data from Oracle BI Server using the JDBC-ODBC bridge. The idea is to use BI Server to import Essbase metadata. Then Oracle Data Integrator would be used to extract the Essbase metadata through MDX via the BI Server and then load into a custom table. Though there are no out of the box RKM’s to reverse engineer BI Server metadata, we can work around them using some other functionality. If you want to extend this, you can create your own custom RKM to reverse-engineer BI Server metadata tables.

To start with lets first import a sample Demo->Basic cube into our BI EE repository. While creating the subject area of this cube, ensure that you do not have spaces/special characters in the column names. If you need the special characters for Answers, then add aliases with new no space/special characters name. For example, if you have Gen1, Year as one of your column names, add an alias as Year.

image

image

The idea behind doing this is to ensure that we can treat these tables as normal tables using the AnalyticsWeb ODBC connection. Of course, we can make ODI to append double quotes if special characters are present in a column or a table name. But for now lets go with this approach.

Once the aliases have been added, go to the Topology Manager and create a universal Data Server using the SUN JDBC-ODBC bridge.

image

image

image

Create a physical schema. Ensure that you are entering the correct subject area name in the schema.

image

Ensure that you are able to test the connection. Once this is done, create a logical schema and assign it to the Physical Data Server through the Global Context.

image

After this go to the designer and create a project. Import the the following Knowledge Modules in to the Project.

1. LKM SQL to SQL
2. CKM SQL

Then create a model. Since we do not have a RKM to reverse engineer the data sources automatically (though you can actually extend other RKM’s for this purpose). So, for now lets manually enter the tables and columns in the Model as shown below

image

Use the Aliases as the column names.

image

image

Now ensure that you are able view the data directly from Essbase using this.

image

image

If you look at the screenshot above, BI Server would be showing the data against the actual names (Gen1, Year etc). So, you can be sure now that the aliases can be accessed even outside of BI EE using the ODBC connection. Now, to make this simple lets create a straight forward table called YEAR_DIM_ESS in any database schema (this will act as our target)

 
CREATE TABLE 
YEAR_DIM_ESS ( 
YEAR VARCHAR2(100), 
QUARTER VARCHAR2(20), 
MONTH VARCHAR2(20)); 

Import this table to another Model. And then create an interface mapping the columns from the source to the target. Ensure that you are using the SUNOPSIS_MEMORY_ENGINE as the staging area.

image

image

image

Now, if you execute the interface, you would have essbase data loaded inside the database table.

image

This is one other good option to consider if you have full set of end to end oracle tools like ODI, Essbase, BI EE etc. In this case today, i have used the JDBC-ODBC bridge. Later i would be covering how we can use the JDBC jar of BI Server directly within ODI.


Categories: BI & Warehousing

Oracle BI EE 10.1.3.4.1 & Essbase Connectivity – Displaying Member Intrinsic & Custom Properties – Aliases and UDAs

Venkat Akrishnan - Sun, 2009-05-31 16:10

One of the common questions asked in the existing BI EE to Essbase connectivity is the ability to display member names in a report instead of the alias names. Currently BI EE does not support displaying the member names(if default alias exist already) in a direct way. So, lets take a look at an approach today which basically extends on the method described here in the modeling guide. Actually,. the method described there is correct but the explanation is partly wrong(in a different context it is right though). It is described there that Member Names are supported for only Level-0 members. It is actually supported for all the generations. But when a drill happens the alias names will return. Lets look at why this happens and of course understand the capability of BI EE in displaying other member intrinsic properties.

The most common question that generally comes up with regard to member names is, why not EVALUATE can be used to display them directly. The main reason why this is not possible is, Member Name is an intrinsic property of a member. There are no MDX functions which can actually be used to display a member name. An essbase member has many intrinsic properties. The intrinsic properties are listed below

1. MEMBER_NAME
2. MEMBER_ALIAS
3. LEVEL_NUMBER
4. GEN_NUMBER
5. IS_EXPENSE
6. COMMENTS
7. RELATIONAL_DESCENDANTS
8. MEMBER_UNIQUE_NAME
9. ANCESTOR_NAME

Apart from the above there are other properties like custom UDA properties etc. Now lets take the example of the Demo Basic cube. If you look at the outline of this cube, it has aliases at the Time dimension level and also for the quarters(not for the level-0 though). Now, our aim is that, whenever we include these levels in the report, the report should automatically display the member names instead of the alias names.

image

The intrinsic properties are typically referred directly in the repository as the External Name.

image

So, in order to refer the alias, lets create a custom physical cube column as shown below.

image

The name for the column can be anything. Basically we are creating an Member Name column for the level that has aliases. In our case it is the quarter level.

image

Assign this new column to the Gen2, Year of the year dimension.

image

Also, make this column to be part of the BMM and the presentation layer. Now, if you create a report on this column and a measure, you would get a report only with the member names for the Quarter Level.

image

But the problem with this approach is that, once you drill on this column, the drills would return. That can be manipulated by re-arranging the level keys accordingly. The main reason why i introduced this was to show a very good feature that can be derived using this approach. In many cases, you would have a report containing 2 or 3 dimension levels and a fact measure. In the same report, you might want to know which dimension member has a specific UDA assigned. For example, consider the outline below

image

If you look at the Market dimension, the 2nd generation has multiple UDAs assigned. Assume that we have a report like the one shown below

image

In the above report, we need one more column stating whether that member has a “Major Market” UDA assigned or not. This is not possible using MDX as the UDA based MDX functions will filter the members based on a UDA (which is not our requirement). So, to start with lets create a custom Physical cube column. In the External name of the column enter Major Market as the External Name. UDA is a custom property of a member. Hence it can be referenced directly as an External name as shown below

image

Now, include this UDA in the Gen2, Region level of the Market Dimension.

image

Once this extra column is included, just include this in the BMM and the presentation layer. Now in the above report, pull in this column. This would basically show all the members having the Major Market UDA as 1. Remaining members that do not have this UDA assigned will be shown as 0.

image

The above technique can be used for other solving other interesting reporting requirements as well. Its heartening to see every aspect of MDX being available in some form or other for customization.


Categories: BI & Warehousing

Oracle Enterprise Performance Management Architect (EPMA) – Administering Essbase, Planning and HFM – Setup

Venkat Akrishnan - Wed, 2009-05-27 12:37

One of the major advantages of Oracle acquiring so many companies is the fact that it integrates all the products in some fashion or the other, that too quickly. For example, if you look at the different possible ways of loading data into Essbase, the list of options available is sometimes absolutely daunting(to an extent flexibility as well) especially for users who are new to the product stack. The following list gives all the possible ways that i can think of for loading data into Essbase

1. Using Essbase Administration Services or EAS
2. Using Essbase Studio (from EPM 11 version)
3. Using Oracle Data Integrator (uses JAPI)
4. Using Hyperion DIM or Data Integration Management
5. Using custom Java, C & VB APIs
6. Using MaxL Scripts through an unix shell or batch script
7. Using Essbase Integration Services (Superceded now by Essbase Studio)
8. Using Oracle Hyperion Enterprise Performance Management Architect

I have covered 7 of the above 8 in prior blog entries. Today we shall see another important tool that is quite commonly used for managing the metadata of Oracle EPM products like Planning, Financial Management & Profitability and Cost Management. This tool called as Enterprise Performance Management Architect or EPMA provides a uniform platform for metadata management across most of the Hyperion components. Apart from its capabilities, one strange aspect to this product is the fact that it depends on IIS to web enable itself. So, you would need a mandatory windows server to host this. When i started using this a couple of months back, my initial impressions were far from impressive. I am not sure whether it was because of my environment or because of the product itself. Whenever EPMA was started, it seemed to be consuming the entire memory(more than the memory occupied by SGA of Oracle and the Essbase Kernel). Having said that, its features(and also the concept of common metadata management) are really good and of course with more usage i am starting to like this more and more.

Today we shall see what it takes to setup EPMA to manage Essbase Applications/Outlines. Just remember the fact that EPMA was never designed to do individual application(Essbase, Planning etc) level administration. That is meant for the respective product administration tools. EPMA is meant for managing the metadata like dimensions, hierarchies, data loads across product sets etc. So, in effect it is like ODI or Hyperion DIM but with more product specific multi-dimensional features thrown in. So, if you are managing Planning, Essbase and HFM (or any of these 2) in your organization EPMA could be a good fit when you want to use a single tool for managing the common dimensions, data loads etc.

To use EPMA for managing Essbase specific application outline members, ensure that you are using Essbase in external mode i.e shared services security should be used. By default when you install EPM in windows, Essbase will be installed with SSO configured against shared services. SSO is not sufficient to use EPMA against Essbase. Ensure that you convert Essbase from local authentication to External authentication. That is done by externalizing the users from Essbase Administration Services.

Once that is done, the next step is to create a data source for the interface tables using the EPM Configurator.

These interface tables are used for importing the pre-defined common dimension types that are available across EPMA. The idea is to have custom members defined in these interface tables and then import them into EPMA. This step is needed only if you have pre-defined members defined in the interface tables. If you are starting from scratch then this is not needed. Once the data source is created, log into EPMA and go to Application Library.

Then create a new Essbase (ASO) application.

Then edit this ASO application and create the dimensions and the corresponding members as shown below

After this step, go to shared services and ensure that the user with which you have logged in as has the necessary privileges to access Essbase. Basically one would need application and database administrator privileges.

Then you can deploy this application directly from EPMA to Essbase.

The major drawback with this is that this does not provide any restructuring options when data is loaded into a deployed cube. Also, one should not be changing the application directly within Essbase using EAS. Then the sync between EPMA and Essbase would be lost and all changes would be over-written when the sync is done from EPMA again. Typically EPMA is not recommended for Essbase applications. It is very good for managing Planning and HFM metadata. One can use shared dimensions wherein the same dimension can be reused across applications.This should give you an idea of how EPMA works. I would go into details of how one can do data synchronization across applications using EPMA in the coming blog entries.


Categories: BI & Warehousing

Oracle BI EE 10.1.3.4.1 – Writebacks to Essbase – Using JAPI and Custom HTML – Part 1

Venkat Akrishnan - Mon, 2009-05-25 14:10

Considering the amount of expectations surrounding the BI EE and Essbase connectivity, i thought it would make a lot of sense to blog about another interesting piece of the Essbase and BI EE integration i.e Writebacks to Essbase from BI EE. Actually i have seen this question being asked by customers/users in quite a few internal presentations that i have been involved recently. Writebacks to Essbase from BI EE is not supported by default. Having said that one can create a custom solution to enable a writeback to an Essbase cell. We shall see one approach of doing this today.

As you would probably know, Writebacks to a relational source from BI EE is supported through custom XML messages. Unfortunately, as of this release, this method cannot be reused for non-relational sources. Basically our requirement is pretty simple. In a BI EE report (reporting against an Essbase source), the end user should have the ability to enter custom values and update the corresponding intersections back in Essbase. The below screenshot explains the requirement pretty clearly.

The high level architecture diagram to enable these writebacks is given below

The high level flow is, for every cell update, the end user will enter the new value and then will click on the update button. That will pass on the parameters to a JSP page using the HTML Form GET method. The JSP will accept the parameters and will in turn pass on the values to the JAPI. The JAPI will then update the Essbase cell. To illustrate this, we shall use the default Demo->Basic cube. Remember the fact that one cannot use the write backs textboxes directly as currently BI EE does not provide a means of referencing the updated/entered value in a cell outside of the XML template. So, we would need to write our own custom HTML to generate textbox and the update buttons.

Import the Demo Basic cube into the repository and create the BMM and presentation layers by drag and drop. Change the physical and the BMM layer aggregations(of the all the measures for which you want to enable writebacks) to SUM instead of Aggr_External. The main reason for doing this is to ensure that we can use string manipulation functions like concatenation from Answers. For more details on each of these aggregations check my blog entries here, here, here and here.

Now, lets go to JDeveloper and create a simple JSP page. Use the below code in the JSP. You can customize this to your needs.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="java.io.*" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.Map.Entry" %>
<%@ page import="java.util.jar.Attributes" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="com.essbase.api.base.*" %>
<%@ page import="com.essbase.api.dataquery.*" %>
<%@ page import="com.essbase.api.session.*" %>
<%@ page import="com.essbase.api.datasource.*" %>
<%@ page import="com.essbase.api.domain.*" %>
<%@ page import="com.essbase.api.metadata.*" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>WriteBackEssbase</title>
  </head>
    <body>
		<font size="5"><%="WriteBack Started" %></font>

<%

        String s_userName = "admin";
        String s_password = "password";
        String s_olapSvrName = "localhost";
        String s_provider = "http://localhost:13080/aps/JAPI";

        try
        {
        IEssbase ess = IEssbase.Home.create(IEssbase.JAPI_VERSION);
        IEssDomain dom = ess.signOn(s_userName, s_password, false, null, s_provider);
        IEssOlapServer olapSvr = (IEssOlapServer)dom.getOlapServer(s_olapSvrName);
        olapSvr.connect();
        IEssCubeView cv = dom.openCubeView("Data Update Example",s_olapSvrName, "Demo", "Basic");

        String v_Market = request.getParameter("p_Market");
        String v_Product = request.getParameter("p_Product");
        String v_Accounts = request.getParameter("p_Accounts");
        String v_Scenario = request.getParameter("p_Scenario");
        String v_Year = request.getParameter("p_Year");
        String v_Value = request.getParameter("p_Value");

        IEssGridView grid = cv.getGridView();
        grid.setSize(2, 5);
        grid.setValue(0, 1, v_Market);
        grid.setValue(0, 2, v_Product);
        grid.setValue(0, 3, v_Accounts); ;
        grid.setValue(0, 4, v_Scenario);
        grid.setValue(1, 0, v_Year);

        cv.performOperation(cv.createIEssOpRetrieve());
        System.out.println("\nData Cell at 2nd-row, 2nd-column: " + grid.getValue(1,1).toString());
        System.out.println ("Market: "+v_Market+" Product: "+v_Product+" Accounts: "+v_Accounts+" Scenario: "+v_Scenario+" Year: "+v_Year+" Value: "+v_Value);

        int row = 1, col = 1;
        if (grid.getCellContentType(row, col) ==
                IEssGridView.CELL_CONTENT_TYPE_DOUBLE) {
            IEssValueAny val = grid.getValue(row, col);
            double dblVal = val.getDouble();

            grid.setValue(row, col, Double.valueOf(v_Value).doubleValue());
        } else if (grid.getCellContentType(row, col) ==
                IEssGridView.CELL_CONTENT_TYPE_MISSING) {
            grid.setValue(row, col, Double.valueOf(v_Value).doubleValue());
        }

        IEssOpUpdate opUpd = cv.createIEssOpUpdate();
        cv.performOperation(opUpd);

        }catch (EssException x){
            System.out.println("ERROR: " + x.getMessage());
        }
%>
<font size="5"><%="WriteBack Ended" %></font>
		<font size="5"><%="WriteBack Ended" %></font>
        </body>
</html>
<%
    //response.sendRedirect("http://localhost:9704/analytics");
%>

I would not explain this in detail as the JSP is self-explanatory. But there is one aspect to writebacks using JAPI that one would have to be aware of. Whenever JAPI is used for writebacks ensure that you have a IEssGridView which basically visualizes your output as an Excel add-in grid. The rows and columns are numbered in an increasing order from zero.

The code snippet that actually does the writeback is given below

Once this is done, this JSP would have to be deployed on a web server that is accessible to BI EE. In order to accomplish that, create a custom WAR profile which would basically contain all the dependent jar files and also the manifest related information.

Then deploy this WAR file on the same application server as BI EE (or OC4J).

Once the deployment is done, test the jsp page by passing the url as shown below

http://localhost:9704/WriteBack/WriteBack.jsp?&p_Value=2000&p_Market=Market&p_Product=Product&p_Accounts=Accounts&p_Scenario=Actual&p_Year=Qtr1

Once this is done, lets create a BI EE report containing all the dimensions. Remember that for writebacks to work in Essbase, we would need a value/member from every dimension. Create a custom column and in the custom colum enter the formula as shown below

'<form name="input" action="http://localhost:9704/WriteBack/WriteBack.jsp">
<input type="text" name="p_Value" size="10"/>
<input type="submit" value="Update" />
<input type="hidden" name="p_Accounts" value="Sales" />
<input type="hidden" name="p_Year" value="'||"Year"."Gen2,Year"||'"/>
<input type="hidden" name="p_Market" value="'||Market."Gen2,Market"||'"/>
<input type="hidden" name="p_Product" value="'||Product."Gen1,Product"||'"/>
<input type="hidden" name="p_Scenario" value="'||Scenario."Gen2,Scenario"||'"/>
</form>'

And change the column format to HTML.

Basically what the formula above does is, it create an HTML input field in the report itself. One parameter p_Value would be obtained from the value of the textbox and the remaining hidden form parameters will be used for passing the dimension member attributes to the url.

If you go to the report now, you can alter the existing values and on submit, these values would be submitted back to Essbase.

The same methodology can be used for writing data back into Oracle OLAP as well. This is one method of doing writebacks. There is one more method as well wherein one can use the Writeback template itself. I will discuss that in future. But for now, the above should give an idea of how Writebacks can be enabled in BI EE against Essbase data sources. There are quite a few moving parts. But again these are required due to the nature of the connectivity as of today.


Categories: BI & Warehousing

Oracle BI EE 10.1.3.4.1 – Scheduling Essbase/Planning Calculation Scripts – Action Framework & Custom Java Remote Procedure calls

Venkat Akrishnan - Thu, 2009-05-21 11:48

In the blog entry here, i had shown you how to run an essbase calculation script from the BI EE dashboards. To make it even more complete, lets look at a means of calling a calculation script through BI Scheduler. So, our idea is to use BI EE as a scheduler to schedule Essbase/Planning calculations. In order to do that there are certain pre-requisites. I have covered this in my blog entry before here. Once the setup is done, lets open the JDeveloper and create a new project. Include the schedulerrpccalls.jar, Ess_japi.jar and Ess_es_server.jar as part of the project properties.

The idea is to basically write a custom java program which in turn will run an Essbase calculation script through the Java API. The java program would then be bundled in the form of a jar file and called from an iBot. Use the below code to login to Essbase and then to execute the calculation.

package bischeduler;

import java.io.*;

import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaExtension;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobInfo;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobException;

import com.essbase.api.base.*;
import com.essbase.api.dataquery.*;
import com.essbase.api.session.*;
import com.essbase.api.datasource.*;
import com.essbase.api.domain.*;
import com.essbase.api.metadata.*;

public class BIScheduler implements SchedulerJavaExtension{
    public BIScheduler() {   

        String s_userName = "admin";
        String s_password = "password";
        String s_olapSvrName = "localhost";
        String s_provider = "http://localhost:13080/aps/JAPI";

        try
        {
        IEssbase ess = IEssbase.Home.create(IEssbase.JAPI_VERSION);
        IEssDomain dom = ess.signOn(s_userName, s_password, false, null, s_provider);
        IEssOlapServer olapSvr = (IEssOlapServer)dom.getOlapServer(s_olapSvrName);
        olapSvr.connect();

        IEssCube cube = olapSvr.getApplication("Global").getCube("Global");
        String maxLstat = "import database 'Global'.'Global' data connect as 'global' identified by 'global' using server rules_file 'UnitsLd' on error abort;";
        //cube.loadData(IEssOlapFileObject.TYPE_RULES,"UnitsLd",0,"SH",false,"global","global");
        cube.calculate(false,"CalcAll");
        //cube.beginDataload("UnitsLd",IEssOlapFileObject.TYPE_RULES,"global","global",0);
        //IEssMaxlSession maxLsess = (IEssMaxlSession)dom.getOlapServer(s_olapSvrName);
        //maxLsess.execute(maxLstat);
        }catch (EssException x){
            System.out.println("ERROR: " + x.getMessage());
        }

    }
    public void run(SchedulerJobInfo jobInfo) throws SchedulerJobException{
        new BIScheduler();
        System.out.println("JobID is:" + jobInfo.jobID());
        System.out.println("Instance ID is:" + jobInfo.instanceID());
        System.out.println("JobInfo to string is:" + jobInfo.toString());
    }
    public void cancel(){};

        public static void main(String[] args) {
        new BIScheduler();

    }
}

Once this is done, create a deployment profile to bundle the code as a jar file. Ensure that the deployment also bundles the 3 jar files mentioned above. Then deploy the jar file.

Now copy the deployed jar file to the {OracleBI}\web\javahost\lib directory (or a directory that you have mentioned as the lib path in the Java host config.xml). Now create an ibot and then in the advanced tab call the deployed jar file as shown below.

You can create ibots in such a way that once the java class run is completed, it would trigger another ibot to deliver a report based on an Essbase cube. This will ensure that the administrator is sure of the fact that the calculation has run successfully.

Now you should be able to run essbase calculations from BI Scheduler directly.  One can even run ODI packages using BI EE. I would cover that as well in future. Keep watching this space next week for a method to do write backs into Essbase. I would present a couple of methods and both of them can be used effectively in a prod like environment.


Categories: BI & Warehousing

Oracle BI EE 10.1.3.4.1 and Essbase Connectivity – Report Based and Essbase based Grand Totals – Answers Based Aggregation

Venkat Akrishnan - Wed, 2009-05-20 05:13

This post here by Christian prodded me to write about another interesting feature in the BI EE and Essbase Connectivity. As you would probably know BI EE supports report based grand totals/sub-totals in a table view. There are 2 types of totals. One is BI Server based totals wherein BI Server would do the totalling on a result set. The other is data source specific totalling wherein the query is fired back to the underlying data source to obtain the totals. For example, lets just quickly import the Demo->Basic cube in to the repository and build a very simple report as shown below.

As you see, it is a very simple report containing a report based total and a sub-total at the market level. Before going further, lets look at the outline of the Basic cube first. As you see, every dimension top member is set as a stored only member.

If you look at the MDX of the above report, you would notice that 3 MDX queries would be fired. One for the base report , one for the grand total and the other for the market sub-total.

The aggregation for the Measure Sales is Aggr_External in both the physical and logical layer. In Answers, the aggregation is set as default. Now, lets go to the outline and convert the Year Dimension top member to be a label only member as shown below.

Now, try running the same report above. You would notice that the report level totals and sub-totals are totally wrong as shown below.

The main reason for this is the fact that since we have converted the topmost member of the outline to be label-only. So for the Year dimension, it will always pick the Qtr1 value instead of totalling all the quarters. For report developers, this would turn out to be an absolute nightmare considering the fact a report based total is created under the assumption that, the totalling is done on the report and not at the data source level. Now, from Answers lets change the aggregation os the sales measure to SUM.

And look at the report.

Basically, a report level SUM ensures that all the custom aggregations/totalling occuring in a pivot table/table are done at the report level instead of at the Essbase layer. So by default, ensure that you always have SUM at the report level to ensure that you do not get wrong answers especially for totals and sub-totals.

This should have given you an idea of how the aggregations at 3 layers (Physical, BMM and the Answers) can affect a report. I would cover the usage of Report Aggregations across different BMM and Physical Layer aggregations in the future.


Categories: BI & Warehousing

Data Mining Survey - Last Call

Marcos Campos - Tue, 2009-03-24 08:41
Rexer Analytics has just issued a last call for its annual data mining survey. This is a pretty nice survey that provides a great deal of valuable information about how data mining is used and who is doing it. To participate, please click on the link below and enter the access code in the space provided. The survey should take approximately 20 minutes to complete.  At the end of the survey you Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com2
Categories: BI & Warehousing

Job Opportunities

Marcos Campos - Mon, 2008-11-03 09:46
The Oracle Data Mining group has two openings for talented software developers and machine learning experts. Take a look at these links (IRC1133401, IRC1143559) for more details.Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com1
Categories: BI & Warehousing

Oracle BIWA Summit 2008

Marcos Campos - Tue, 2008-10-28 04:10
The Oracle BIWA Summit 2008 is approaching  (December 2-3) . It will be held at Oracle World HQ, Redwood Shores, California. This is the second event of its kind. Last year's event was a great success and lots of fun (see details here ). This year's keynotes include Jeanne Harris (co-author of "Competing on Analytics") and Usama Fayyad (legendary data miner).  Here are some information and linksMarcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com1
Categories: BI & Warehousing

Collective Intelligence 1: Building a RSS Feed Archive

Marcos Campos - Mon, 2008-09-08 22:10
For a long time I have thought that we needed data mining books written for developers. Most data mining books are written for business or data analysts. Given that, it was a pleasant surprise to read Programming Collective Intelligence: Building Smart Web 2.0 Applications by Toby Segaran. The book provides a good discussion on data mining concepts anchored with interesting examples. It also Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com5
Categories: BI & Warehousing

Data Mining in Action: Oracle Sales Prospector

Marcos Campos - Fri, 2008-08-22 12:10
I firmly believe that a major trend in applications is the incorporation of analytic-enabled functionality. Users want more than just reports or a replay of the past. Users want to have insights and their attention directed to key points. This is where analytics can make a big impact across all types of applications. Notice that I am not proposing exposing analytical capabilities (e.g., data Marcoshttp://www.blogger.com/profile/14756167848125664628noreply@blogger.com2
Categories: BI & Warehousing

Pages

Subscribe to Oracle FAQ aggregator - BI &amp; Warehousing