12
Implicit Fact Column Take an example that we have 2 dimension tables viz. Day Dim & Opty Dim and 2 fact tables viz. Revenue Fact & Order Fact. Now, I wana make my report in such a manner where i take only 2 dimension columns from the 2 dim tables and no fact column eg: I wana c number of opptys in an year. What will happen??? When the report will run, the data will be fetched by joining the dimension(Day Dim) with dimension(Opty Dim) through a fact table(Order Fact or Revenue Fact) .Now, sometimes in these cases the server gets confused that from which fact table it should join so as to fetch the data. Then what the server does, is that, it joins with the nearest fact(eg: Order fact) and pulls the data through it. But this can sometimes causes issues and may fetch incorrect data. Because if the user want to see the data based on the Revenue Fact and server joins with Order fact and pulls the data, then the number of Optys per Year can differ in count as there many be different Opty wids in both the facts. I guess u got wht i meant…. So, to take care of this issue we can assign an Implicit Fact Column in the Presentation catalog in the Admin tool. This column is generally the lowest granularity column of the fact table like Row_wid etc. By setting this column in the presentation catalog the server takes the join from a particular fact table whoose column is specified in the Implicit fact column for that particular presentation catalog.. We can set the implicit fact column as shown below: What are the different types of Variables that can be associated to an Initialisation Block? Repository Variables and Session Variables

obiee 04052012

Embed Size (px)

Citation preview

Page 1: obiee 04052012

Implicit Fact Column

Take an example that we have 2 dimension tables viz. Day Dim & Opty Dim and 2 fact tables viz. Revenue Fact & Order Fact. Now, I wana make my report in such a manner where i take only 2 dimension columns from the 2 dim tables and no fact column eg: I wana c number of opptys in an year.

What will happen???When the report will run, the data will be fetched by joining the dimension(Day Dim) with dimension(Opty Dim) through a fact table(Order Fact or Revenue Fact) .Now, sometimes in these cases the server gets confused that from which fact table it should join so as to fetch the data. Then what the server does, is that, it joins with the nearest fact(eg: Order fact) and pulls the data through it.

But this can sometimes causes issues and may fetch incorrect data. Because if the user want to see the data based on the Revenue Fact and server joins with Order fact and pulls the data, then the number of Optys per Year can differ in count as there many be different Opty wids in both the facts.

I guess u got wht i meant….

So, to take care of this issue we can assign an Implicit Fact Column in the Presentation catalog in the Admin tool. This column is generally the lowest granularity column of the fact table like Row_wid etc. By setting this column in the presentation catalog the server takes the join from a particular fact table whoose column is specified in the Implicit fact column for that particular presentation catalog..

We can set the implicit fact column as shown below:

What are the different types of Variables that can be associated to an Initialisation Block? Repository Variables and Session Variables

What are Repository Variables?Repository Variables are populated when the OBIEE Server is started and are refreshed at their refresh interval. These variables are either Static or Dynamic

Static Repository variables holds constant values. The main purpose of these variables are its value is defined at one place and these variables can be used at various places in rpd.Eg Datasource Name defined in Variables OLAP_DSN,OLTP_DSN.

Dynamic Repository Variables are those variables which are populated by a Initialisation block's SQL. These Initialisation blocks are fired when the OBIEE Server is started and are refreshed at their refresh interval.

Page 2: obiee 04052012

eg DATE stored in variable CUR_DTSQL : SELECT SYSDATE FROM DUAL

What is the difference between a Repository Variable and Session Variable?Repository variables are those variables whose values are independant of user login.Session variables are those variables whose values are dependant on user login. These variables are populated for a user when he Logs in.

What is the difference between System Session Variable and Non System Session Variable?System Session Variables are predefined session variables used by OBIEE Server for specific purposes. eg USER, GROUP.

Non System Session Variables are Customised Session Variables. Eg User's Primary Position

Why do We Create Dimensional Hierarchies?Dimensional Hierarchies are created to configure drill downs, level based measures and Aggregate Navigation

What are level based measures?Level Based measures are those measures which are computed at a specific level. These measures displays the values at their specified level even if it is queried with a low level attributes.

Explain the significance of Number of Elements at this level in Dimensional Hierarchy?"Number of Elements at this level" is used to specify the number of distinct records at a specified level. OBIEE Server uses this in Aggregate Navigation to generate the Optimum SQL.

Why do we create Complex joins in BMM Layer?All joins created in the BMM Layer should be Complex Joins. Creating a Complex Join between two Logical tables enables the OBIEE Server to pick up the optimum sql.

eg We have a logical dimension table which has two logical table sources with one the main dimension table and the other snow Flaked normalised dimension and a logical fact table which has two logical table sources with one the fact table and the other an Aggregate table.

When a request can be satisfied by a sql using the main dimension table joined to a Fact Table or through an Aggregate table joined to a snow Flaked normalised dimension. Since the number of records are less in the aggregate table the server picks up the Join between the Aggregate table and the snow Flaked normalised dimension. Hence We define only a join between the logical tables and based on the BMM Layer configuration, the server picks up the Optimum Join between the Physical tables.

Where do we specify the Outer Join between two tables in OBIEE?The Type of the Join is specified in the Logical Table Source in the BMM Layer.

What is the difference between WHERE Clause and Fragmentation Content of a Logical Table Source?Filters applied in the WHERE Clause will be always always applied whenever the Logical table Source Qualifies

Page 3: obiee 04052012

Filters applied in the Fragmentation Content is used by the OBIEE Server to Qualify a logical Table Source if the Filter in the Request matches with the Filter in the Fragmentation content.

Why do we create an alias table in OBIEE?It is a best Practice to use Alias table for all tables used in a business model. Seperate aliases needs to be made for Seperate Business models.

Seperate Aliases for a Table are made in a single Star Schema, if it is a Role Playing Dimension (eg Open Date(W_DAY_D) and Close Date(W_DAY_D) joined to a Fact)

Alias Tables are also made for a table having Self Join(eg Employee(W_EMPLOYEE_D) and Manager(W_EMPLOYEE_D)

When do we use Complex Joins in Physical layer?Complex Joins are used in Physical layer when we need to do a calculation on a join condition between two tables.eg UPPER(W_EMPLOYEE_D.NAME)=W_CUSTOMER_D.EMP_NAME

What is the configuration that needs to be done in rpd to generate an Inline view in the SQL?A Physical table with type select needs to be created, and the sql of the inline view needs to be put in the Default initialisation string. Physical Table with Type Select are used to generate Inline Viewseg SQL Inputselect T1.abc,T2.bac from w_bnj_d T1, (select distinct bac,emp from w_abc_d) T2 where T1.emp_id=T2.empThe sql "select distinct bac,emp from w_abc_d" will be the sql in the default initialisation string and necessary joins needs to be made in the Physical layer.

How do We create Sub Folders in the Presentation Layer?Prefix an hyphen and space before the name of the Sub folder.

Can We create a Subject Area from two different Business models?No, it is not possible.

How do we rename a presentation table so that its alias name is retained?We need to right click on the column and select rename and then we need to give the new name. Double clicking on it and renaming it does not retain the alias name.

What is the Use of Retaining the Alias Name in the Presentation Layer?Alias name keeps track of the Previous names of an object.These names are used by the reports having objects referencing to their prevoius names.

eg I have a report Customer.Id, Employee.name from Sales

Now If want to rename the column "Id" under Customer Folder to "Customer Id" without modification of any report, I need to retain the Alias name Id for the Column Customer Id, so that the above report

Page 4: obiee 04052012

column Customer.Id points to the Customer.Customer Id

Explain the significance of Implicit Fact Column in the Presentation Catalog?Implicit Fact column is used by the OBIEE Server to define the path when a request confines to only dimension tables. It just adds this implicit fact column to the request to generate the SQL, however this column will not be present in the results.

How do we create a Presentation column that its name should display Western Region for West Users and Region for remaining users? We need to create a session variable say REG_NM which takes the above names for their groups. For the presentation column we need to uncheck the use logical column name and check the check box of Custom Display name and name it as VALUEOF(NQ_SESSION.REG_NM)

How do we Create two Sub Folders under different Folders with the same name in the Presentation Layer?Both the Sub Folders will have a hyphen followed by the space with their name and they will be placed below the corresponding folders with different presentation table names. Now for the Second Table we will give the Custom display name as the first table.

Eg Region Folder has to be brought under both Customer and Employee Folder. Presentation Layer will look like

Customer- RegionEmployee- Emp Region

For - Emp Region presentation table, we will have custom display name as Region.

Reports

Standard

How do we create level based measures in Answers?Level based measures can be created in the report by aggregating the fact by the level. eg SUM(Facts.Revenue BY Time."Year")

SELECT Time."Year" saw_0, Time."Month" saw_1, Facts.Revenue saw_2, SUM(Facts.Revenue BY Time."Year") saw_3 FROM "Sales Applications" ORDER BY saw_0, saw_1

Page 5: obiee 04052012

How do we configure a report with all its Sub Totals displayed at the bottom?

eg I have a report with 3 columns class, Target/Achieved and Revenue. We need to display for every class its target in 1 row achieved in the next row. Sub Total for Target and achieved at the bottom of the report.

Create the report with all the 3 attributes add one more column sort order with column formula 1. Union this report with other report with columns Total(hard coded), and the other two columns with the sort order column taking value 2 Sort with Sort Order ascending and hide the column. Do a conditional formatting for all columns with if class='Total' eg like blue background etc.

Page 6: obiee 04052012

Report Configuration

Thus we can achieve a report with all Sub totals at the bottom of the report

Tough

How do we use COMPLEX FROM CLAUSE in Advanced SQL Clauses in OBIEE?

Reports from multiple subject areas can be combined by joining the common attributes by putting the individual sqls in the from clause and specifying the joining conditions. This query is similar to sql query with inline views.

Logical SQL of individual reports

SELECT Dims.Class saw_0, Facts."# of Customers" saw_1 FROM "All Application" ORDER BY saw_0

SELECT Dim.Class saw_0, Dim."Year" saw_1, Fact.Revenue saw_2 FROM "Sales Application" ORDER BY saw_0, saw_1

Page 7: obiee 04052012

Logical sql of the combined report

SELECT A.saw_0 saw_0, b.saw_1 saw_1, A.saw_1 saw_2, B.saw_2 saw_3 FROM (SELECT Dims.Class saw_0, Facts."# of Customers" saw_1 FROM "All Application" ) A Full outer join (SELECT Dim.Class saw_0, Dim."Year" saw_1, Fact.Revenue saw_2 FROM "Sales Application" ) b on a.saw_0=b.saw_0 WHERE A.saw_0 <>'Unspecified' ORDER BY saw_0, saw_1

It should be noted that we want to combine the two report via the common attribute class and full outer join is introduced to fetch all the records. Thus we can combine multiple reports via a Join.

How do we combine two reports from different Subject areas by Combining the common attributes?

eg We have Customer,Employee, Revenue from Sales Analysis Subject Area and Customer,Employee, Activity Cost from Activity Analysis Subject Area, we need to create a single report with Customer,Employee, Revenue and Activity Cost.

Create a union all report from these two Subject areas and build a pivot table with aggregation of max.

Page 8: obiee 04052012

Thus we can combine two reports from different Subject areas by Combining the common attributes.

How do we create a report with metrics of Multiple Granularity?

eg we have Account,project and services as dimensions and period and revenue as metrics. One Account can have multiple projects and each project can have multiple services. Period is at a Project level and revenue at each Project service level. Create a report at account level with these two metrics summed up at appropriate granularity.

create the report by adding all attributes.

for the period metric apply the formula as shown in the below figure

Page 9: obiee 04052012

create a pivot table as shown in the figure apply aggregation sum and uncheck the report based total option.

view the results.

Thus we can create a report with metrics of multiple Granularity.