Oracle BI EE 11g - New BI Server Functions
As mentioned in the blog entry here, BI Server 11g now supports more functions which were added to support the new UI features. Each of these functions can be used as part of the Logical SQL or can even be used directly in the Answers UI. In this blog entry we shall be looking at how some of these functions can be used.
1. SELECT_PHYSICAL: Though this is not a function, this is a new feature supported by BI Server that can bypass the BMM layer in the SQL queries. So, any SQL that uses SELECT_PHYSICAL will be more closer to the ANSI SQL standard. There are 2 main advantages of this
a. Any external reporting tools that generate SQL automatically can now leverage the functionality of BI Server. For example, in the blog entry here i had shown the difficulty in actually using Logical SQL with Cognos. But introduction of SELECT_PHYSICAL should alleviate this issue thereby making BI Server open for better integration externally.
b. Using SELECT_PHYSICAL one can now make direct joins across data sources without actually having the need to model them separately in the Business Model and Mapping layer.
With the addition of more in-memory operations in the BI Server, this should act as a point of integration for external tools that have the need to leverage the metadata framework of BI EE.
To illustrate how this works, lets look at the repository shown below,
SELECT_PHYSICAL 0 s_0, CHANNEL_CLASS s_1, SUM(AMOUNT_SOLD) s_2 FROM "ORCL - SH".."SH"."CHANNELS" A, "ORCL - SH".."SH"."SALES" B WHERE A.CHANNEL_ID = B.CHANNEL_ID GROUP BY CHANNEL_CLASS
Remember, though this is a SELECT_PHYSICAL SQL statement, BI Server will still do the parsing as the objects will have to reside inside the repository.
2. AGGREGATE AT:
This function adds more multi-level analysis capabilities within the BI Server. This function provides the same functionality as the Level Based Measures. What this does is, it provides an ability to extract the values of a parent level in a query without having to SUM up the values in the lower level. To illustrate, lets look at the simple report below
AGGREGATE("Sales"."AMOUNT_SOLD" AT "Times"."TimesDim - Calendar Year"."Calendar Year")
WITH SAWITH0 AS (select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3, D1.c4 as c4, D1.c5 as c5 from (select sum(T44515.AMOUNT_SOLD) as c1, T44523.CALENDAR_QUARTER_DESC as c2, T44523.CALENDAR_QUARTER_ID as c3, T44523.CALENDAR_YEAR as c4, T44523.CALENDAR_YEAR_ID as c5, ROW_NUMBER() OVER (PARTITION BY T44523.CALENDAR_QUARTER_ID ORDER BY T44523.CALENDAR_QUARTER_ID ASC) as c6 from TIMES T44523, SALES T44515 where ( T44515.TIME_ID = T44523.TIME_ID and (T44523.CALENDAR_QUARTER_NUMBER in (1, 2)) ) group by T44523.CALENDAR_QUARTER_DESC, T44523.CALENDAR_QUARTER_ID, T44523.CALENDAR_YEAR, T44523.CALENDAR_YEAR_ID ) D1 where ( D1.c6 = 1 ) ), SAWITH1 AS (select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3 from (select sum(T44515.AMOUNT_SOLD) as c1, T44523.CALENDAR_YEAR as c2, T44523.CALENDAR_YEAR_ID as c3, ROW_NUMBER() OVER (PARTITION BY T44523.CALENDAR_YEAR_ID ORDER BY T44523.CALENDAR_YEAR_ID ASC) as c4 from TIMES T44523, SALES T44515 where ( T44515.TIME_ID = T44523.TIME_ID ) group by T44523.CALENDAR_YEAR, T44523.CALENDAR_YEAR_ID ) D1 where ( D1.c4 = 1 ) ), SAWITH2 AS (select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3, D1.c4 as c4, D1.c5 as c5, D1.c6 as c6 from (select 0 as c1, D1.c2 as c2, case when D2.c2 is not null then D2.c2 when D1.c4 is not null then D1.c4 end as c3, D1.c1 as c4, D2.c1 as c5, D1.c3 as c6, ROW_NUMBER() OVER (PARTITION BY D1.c2, D1.c3, case when D2.c2 is not null then D2.c2 when D1.c4 is not null then D1.c4 end ORDER BY D1.c2 ASC, D1.c3 ASC, case when D2.c2 is not null then D2.c2 when D1.c4 is not null then D1.c4 end ASC) as c7 from SAWITH0 D1 left outer join SAWITH1 D2 On D1.c5 = D2.c3 ) D1 where ( D1.c7 = 1 ) ) select D1.c1 as c1, D1.c2 as c2, D1.c3 as c3, D1.c4 as c4, D1.c5 as c5 from SAWITH2 D1 order by c1, c3 NULLS FIRST, c2
3. CALCULATEDMEMBER:
This function is used to derive calculated members using members at any level of a hierarchy. In 10g, we can do this from a pivot table. In 11g, this function has been introduced at the BI Server level itself so that we can leverage these directly from the repository.
To illustrate this, consider the hierarchy shown below
CALCULATEDMEMBER("HR"."Employee"."EmployeeDim",'Test', MEMBER(100) - MEMBER(101) -MEMBER(102))
This is another significant new feature that can be useful to push down the oracle database analytic functions. I have covered EVALUATE number of times before for function shipping database functions. EVALUATE_ANALYTIC extends that further and provides us an ability to function ship the analytic functions as well. The syntax of this function remains the same. I will cover this in detail in another blog post as there are quite a few use cases where EVALUATE_ANALYTIC can prove to be very useful.
5. HIERARCHICAL FUNCTIONS:
BI Server now supports hierarchical functions like ISCHILD, ISROOT, ISANCESTOR, ISDESCENDANT & ISLEAF that can be used to traverse a Parent-Child hierarchy. These functions generally return a boolean data type (true/false) and hence can be used in filters to restrict data. They can also be used in column formula case statements.
For example, in a hierarchy if we want to know whether a specific member is a leaf node or not, we can use the below function to display Yes/No as an attribute of the parent-child hierarchy
CASE WHEN ISLEAF(Employee.EmployeeDim) THEN 'Yes' ELSE 'No' END