Wednesday 24 August 2011

Obiee – A special subject area to handle the dashboard parameters prompts


All the prompts in OBIEE are column based prompt. You can’t create a prompt if you don’t select a column. And as it’s the only way to set up a variable for a formula, it’s impossible to bypass this constraint.


In our case, we don’t care about the value in the dimension column as we want parameter values as for instance the hierarchy level :


{{:dat:obiee:presentation_service:obiee_parameter_prompt_result.jpg|}}


The idea behind the scene is :
– to create a column which is on the top of a dual view (or skinny table) in the physical layer.
– to create a dummy business model because BI Server requires us to have a minimal of one logical join.
– to create a special subject area (presentation catalogue) to separate the functional of the parameters columns
– to be able to choose this column in order to create one or several others parameter prompts.


The advantages of this solutions are that :
* as you query a skinny table (or dual view), the performance are very good
* as you use a column, you can translate in other languages the label of the parameter prompt
* you can add a parameter value without changing the original dashboard prompt


===== Creation of the Parameter Table =====


In this example, we show the creation of a parameter table with a dual view but you can choose to create a table to store your parameters.


* In the physical layer, right click on a physical schema and choose New Physical Table
* select “Select” as Table Type from the drop down menu
* and enter the Sql below


Example :


SELECT ‘MONTH’ AS REPORT_LEVEL FROM DUAL
UNION
SELECT ‘QUARTER’ AS REPORT_LEVEL FROM DUAL


{{:dat:obiee:presentation_service:obiee_dummy_table.jpg|}}


Second, you need to create the column report_level from the sql statement.
* click on the column tab and create it


{{:dat:obiee:presentation_service:obiee_dummy_table_columns.jpg|}}


If you choose this column in a query, the values MONTH and QUARTER will be returned.


===== Creation of the Business Model Layer =====
* Drag and drop **TWO** times this table in order to create two logical table source :
* Parameters1
* Parameters2
* Select this two tables,
* Right click / Business Model Diagramm / Selected Tables only
{{:dat:obiee:presentation_service:obiee_dummy_business_model.jpg|}}
* and create a new complex join between them.
{{:dat:obiee:presentation_service:obiee_dummy_model_2.jpg|}}


This step is important beacause Obiee require that a fact table has minimum one complex logical join


===== Creation of the Presentation Catalog =====
* Right click in the presentation layer / New Presentation Catalog and name it Parameter
* Just drag and drop one of the two logical table and you are done.
* You can cache this new presentation catalog to the others users by giving the correct privilege. In the Oracle BI Presentation Dashboard / Administration / Manage Privileges.
* Reload the metadata in the BI Presentation Dashboard in Administration / Reload Files and metadata


{{:dat:obiee:presentation_service:obiee_parameter_subject_privilege.jpg|}}


In the picture above, you can see that only the Presentation Server Administrator have the right to the Parameter Area but everybody can use a object (report, prompt) create with it


===== Creation of the dashboard prompt =====


Now that we have our parameter column in our parameter subject area, it’s possible to choose it in order to create a parameter prompt.


* Go to answer
* Click on the icon : New Dashboard prompt on the left side
* And select the subject area Parameter
{{:dat:obiee:presentation_service:obiee_new_dashboard_prompt.jpg|}}
* in the left frame, select the column of the select table (in our case report_level)
* and define the options that you need as the setting of a presentation variable
{{:dat:obiee:presentation_service:obiee_parameter_prompt.jpg|}}
* and you get :
{{:dat:obiee:presentation_service:obiee_parameter_prompt_result.jpg|}}


===== What about now if I don’t want MONTH and QUARTER but MONTH and YEAR ? =====


You can change the values in your parameter table or you can use the SQL value capabilities of the prompt :
* Go back to your prompt
* select SQL Value in the show result
* and tape this SQL :


SELECT CASE WHEN 1=0 THEN Parameters.REPORT_LEVEL ELSE ‘MONTH’ END FROM Parameter
UNION
SELECT CASE WHEN 1=0 THEN Parameters.REPORT_LEVEL ELSE ‘YEAR’ END FROM Parameter


As one is always different of zero, you will obtain MONTH and YEAR as value in the drop down list.


You can not enter this SQL :


SELECT ‘MONTH’ FROM Parameter
UNION
SELECT ‘YEAR’ FROM Parameter


because Parameter describe a presentation catalog and not a table. In the Sql of OBIEE, you really need to have for each column the name of the table otherwise you will obtain this error :


Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred.
[nQSError: 42021] The query does not reference any tables. (HY000)
SQL Issued: SELECT ‘MONTH’ FROM Parameter


===== Performance =====
As we use a dual or a skinny table as source table, the performance are really good.


===== Conclusion =====
You can add to your parameter subject area one column by parameter or you can change the values with the SQL capabilities from the prompt. In the two case, a sql statement against a little table of Oracle is performed and doesn’t therefore require to read data by an I/O operation on a disk. You can therefore choose your preferred solution but keep in mind that one column for one dashboard prompt is the natural Obiee mechanism and permit a good translation in other languages.


 


View the original article here

OBIEE – Dimension fragmentation design to add an automatic filter with the choice of a column


In response to an original Idea of Venkat with this blog entry: [[http://www.rittmanmead.com/2010/02/13/oracle-bi-ee-10-1-3-4-1-puzzlers-puzzle-1/|Puzzlers – Puzzle 1]]


“How do we make BI EE to generate different filters for every column(within a dimension) chosen from Answers?”


The idea is when you add the column Channel desc to an answer the query must be automatically filtered.


You can also found a copy of this entry in the wiki : [[http://gerardnico.com/wiki/dat/obiee/dimension_fragmentation_filter|OBIEE - Dimension fragmentation design to add an automatic filter with the choice of a column]]



An other simple solution to achieve this goal is to use the security filter:
[[dat:obiee:bi_server:security:security_automatic_filter_on_column]]



After a good night of rust, I deleted the alias of the physical table Channels because this solution creates a self join on the table channels. You can see the old solution [[dat:obiee:dimension_fragmentation_filter#the_old_solution|here]]


===== The design =====
*- Suppress the old logical column “Channel Desc”, create a new one with the same name
* 1 – Create a new logical table source “CHANNELS_FILTER” in the logical table Channels
* 2- Map the new logical column Channel Desc to the physical Column Channels.”Channel Desc” in the tab “Column Mapping”
* 3- Add the filter in the content tab
* – Drag and drop the new logical column in the presentation layer


{{:dat:obiee:repository_design_filter_on_column_new_logical_table.jpg|}}


===== The result =====


==== With the column “Channel class” and “Amount Sold” ====
**Sql Request**


SELECT Channels.”Channel Class” saw_0, “Sales Facts”.”Amount Sold” saw_1 FROM SH ORDER BY saw_0


{{:dat:obiee:repository_design_filter_on_column_result1.jpg|}}


As you can see no filter is added to the database query.


**Database Query**


select T161.CHANNEL_CLASS as c1,
sum(T245.AMOUNT_SOLD) as c2
from
SH.CHANNELS T161,
SH.SALES T245
where ( T161.CHANNEL_ID = T245.CHANNEL_ID )
group by T161.CHANNEL_CLASS
order by c1


==== With the column “Channel desc” and “Amount Sold” ====
**Sql Request**


SELECT Channels.”Channel Class” saw_0, Channels.”Channel Desc” saw_1, “Sales Facts”.”Amount Sold” saw_2 FROM SH ORDER BY saw_0, saw_1


By adding the column Channels.”Channel Desc”, OBIEE add automatically a filter and the join between the original table channel and its alias


{{:dat:obiee:repository_design_filter_on_column_result2.jpg|}}


**Database Query**


select T161.CHANNEL_CLASS as c1,
T161.CHANNEL_DESC as c2,
sum(T245.AMOUNT_SOLD) as c3
from
SH.CHANNELS T161,
SH.SALES T245
where ( T161.CHANNEL_ID = T245.CHANNEL_ID and T161.CHANNEL_CLASS = ‘Direct’ )
group by T161.CHANNEL_DESC, T161.CHANNEL_CLASS
order by c1, c2


==== With the column “Channel desc” and “Channel class” ====
**Sql Request**


SELECT Channels.”Channel Class” saw_0, Channels.”Channel Desc” saw_1 FROM SH ORDER BY saw_0, saw_1


**Database Query**


select distinct T161.CHANNEL_CLASS as c1,
T161.CHANNEL_DESC as c2
from
SH.CHANNELS T161
where ( T161.CHANNEL_CLASS = ‘Direct’ )
order by c1, c2


 


View the original article here

OBIEE 10g Vs OBIEE 11g

The security policy for Oracle Business Intelligence 11g defines what individual users and users with certain application roles can access and do. In Oracle Business Intelligence 11g, the security policy definition is split across the following:


Presentation Catalog – this defines which catalog objects and Oracle BI Presentation Services functionality given users and application roles can access.


RPD – this defines which application roles and users have access to which items of metadata within the RPD. You define this security policy in the Administration Console.


Policy Store – this defines which Oracle Business Intelligence Server, Oracle Business Intelligence Publisher and Real Time Decisions functionality can be accessed by given users or users with given application roles. Use Oracle Enterprise Manager to configure the default Oracle Business Intelligence Policy Store.


Oracle Business Intelligence10g and 11g security models differ in the following areas:


Defining users and groups – in Oracle Business Intelligence 10g, it was possible to define users and groups within a repository file using the Oracle BI Administration tool. In Oracle Business Intelligence 11g, you can no longer define users and groups within a repository. The Oracle Business Intelligence Enterprise Edition Upgrade Assistant migrates users and groups from a 10g repository into the embedded LDAP server in an 11g installation.


Defining security policies – in Oracle Business Intelligence 10g, security policies in the Web catalog and repository can be defined to reference groups within a directory. In Oracle Business Intelligence 11g, security policies are defined in terms of application roles, which are in turn mapped to users and groups in a directory. This allows an Oracle Business Intelligence 11g system to be deployed without changes to the corporate directory and eases movement of artifacts between development, test and production environments.


Use of the Administrator user – in an Oracle Business Intelligence 10g installation, a special user named, Administrator has full administrative permissions and is also used to establish trust between processes within that installation. In Oracle Business Intelligence 11g there is no special significance to the name Administrator and there can be one or more users who are authorized to undertake different sets of administrative functions. In Oracle Business Intelligence 11g the identity used to establish trust between processes in an installation is configurable and independent.


Repository encryption – in Oracle Business Intelligence 10g, certain sensitive elements within a repository are encrypted. In Oracle Business Intelligence 11g, the entire repository is encrypted using a key derived from a user supplied password. An 11g repository can only be opened with the password, and there is no mechanism to recover a lost password.


The following aspects of the Oracle Business Intelligence 10g security model remain in 11g:


Oracle Business Intelligence Server Initialization Blocks – Oracle Business Intelligence Server 11g continues to support the use of initialization blocks for authentication and authorization. In 10g Oracle Business Intelligence Server falls back to use initialization blocks if a matching user cannot be found in the repository. In 11g Oracle Business Intelligence falls back to use initialization blocks if the user cannot be authenticated by the installation’s configuration authentication provider.


Presentation Catalog Groups – Oracle Business Intelligence 11g continues to support the definition of catalog groups within the presentation catalog. These groups are only visible within Oracle Business Intelligence Presentation Services. Oracle recommends that presentation catalog groups be used for backward compatibility only and that application roles be used instead for new installations.


SA System Subject Area – Oracle Business Intelligence 11g supports the use of SA System Subject Area in combination with Oracle Business Intelligence Server initialization blocks to access user, group, and profile information stored in database tables.


 


View the original article here

Densification with OBIEE logical Sql (Sparse to dense data)

You may want to view the data in [[analytic:dense_sparse|dense]] form, with rows for all combination of dimension values displayed even when no fact data exist for them.


And it’s also the most problem that you have when you work with [[analytic:function_time|time series calculations]] as the [[dat:obiee:presentation_service/obiee_period_to_period_lag_lead_function|lag/lead function]], is that the data are not [[analytic/dense_sparse|dense]].


This article show the capability of the [[dat:obiee:logical_sql:|OBIEE logical sql]] to [[analytic:data_densification_sparse_to_dense|densify]] the data. To know more about the Obiee logical Sql, you can also read the good post of [[http://oraclebizint.wordpress.com/2009/05/07/oracle-bi-ee-101341-understanding-logical-sql-part-1/|Venkatakrishnan]].


The sample example come from this article : [[analytic:data_densification_sparse_to_dense]] and the sql below is a translation in [[dat:obiee:logical_sql:|OBIEE logical sql]] of [[analytic:data_densification_sparse_to_dense#densification_with_cross_join_and_outer_join|the densification solution with cross and right outer join]].


As the gold rule is to embedded the difficulties in the repository, I highly recommend this solution instead : [[dat:obiee:bi_server:design:obiee_densification_design_preservation_dimension]].


===== Sparse data to densify =====


A typical situation in the [[database:oracle:sample_schemas|sh schema]] with a sparse dimension is shown in the following example, which computes the weekly sales and year-to-date sales for the product Bounce for weeks 20-30 in 2000 and 2001:


SELECT SUBSTR(p.Prod_Name,1,15) Product_Name,
t.Calendar_Year Year,
t.Calendar_Week_Number Week,
SUM(Amount_Sold) Sales
FROM
Sales s,
Times t,
Products p
WHERE
s.Time_id = t.Time_id AND
s.Prod_id = p.Prod_id AND
p.Prod_name IN (‘Bounce’) AND
t.Calendar_Year IN (2000,2001) AND
t.Calendar_Week_Number BETWEEN 20 AND 30
GROUP BY
p.Prod_Name,
t.Calendar_Year,
t.Calendar_Week_Number
order by
product_name,
year,
week asc



PRODUCT_NAME YEAR WEEK SALES
————— ———- ———- ———-
Bounce 2000 20 801
Bounce 2000 21 4062.24
Bounce 2000 22 2043.16
Bounce 2000 23 2731.14
Bounce 2000 24 4419.36
—- Miss one row for the week 25
—- Miss one row for the week 26
Bounce 2000 27 2297.29
Bounce 2000 28 1443.13
Bounce 2000 29 1927.38
Bounce 2000 30 1927.38
Bounce 2001 20 1483.3
Bounce 2001 21 4184.49
Bounce 2001 22 2609.19
Bounce 2001 23 1416.95
Bounce 2001 24 3149.62
Bounce 2001 25 2645.98
—- Miss one row for the week 26
Bounce 2001 27 2125.12
—- Miss one row for the week 28
Bounce 2001 29 2467.92
Bounce 2001 30 2620.17


In this example, we would expect 22 rows of data (11 weeks each from 2 years) if the data were dense. However we get only 18 rows because weeks 25 and 26 are missing in 2000, and weeks 26 and 28 in 2001.


===== The cross join and the outer join =====



select D.saw_0, D.saw_1, D.saw_2, A.saw_3
FROM
(
SELECT
Products.”Prod Name” saw_0,
Calendar.”Calendar Year” saw_1,
Fiscal.”Fiscal Week Number” saw_2,
“Sales Facts”.”Amount Sold” saw_3
FROM SH
WHERE
(Calendar.”Calendar Year” IN (2000, 2001))
AND (Products.”Prod Name” = ‘Bounce’)
AND (Fiscal.”Fiscal Week Number” BETWEEN 20 AND 30)
) A RIGHT OUTER JOIN
(
SELECT C.saw_0 saw_0, B.saw_0 saw_1, B.saw_1 saw_2 FROM
( Select Calendar.”Calendar Year” saw_0, Fiscal.”Fiscal Week Number” saw_1
FROM SH
WHERE Calendar.”Calendar Year” IN (2000, 2001)
AND Fiscal.”Fiscal Week Number” BETWEEN 20 AND 30 ) B,
( Select Products.”Prod Name” saw_0 FROM SH WHERE Products.”Prod Name” = ‘Bounce’ ) C
) D
ON ( A.saw_0 = D.saw_0 and A.saw_1 = D.saw_1 and A.saw_2 = D.saw_2 )
ORDER BY D.saw_0, D.saw_1, D.saw_2


===== The result in answer =====


{{:dat:obiee:presentation_service:obiee_logical_sql_densification.jpg|}}


===== The result in issue sql =====


In dashboard, Setting / Administration / Issue Sql


{{:dat:obiee:presentation_service:obiee_sh_densification.jpg|}}


 


View the original article here

Oracle Business Intelligence 11g

Logical Architecture


Oracle Business Intelligence Logical Architecture


Description of Figure 3-1 follows


The Oracle Business Intelligence domain contains three main components: a WebLogic domain, Oracle Business Intelligence System Components, and a database. Each main component is represented in its own rectangle contained within the Oracle Business Intelligence Domain rectangle. The Database component rectangle contains only a database, however the WebLogic domain and Oracle Business Intelligence System Components rectangles contain several subcomponents each.


A typical Oracle Business Intelligence installation consists of a Fusion Middleware home and the following subdirectories:


wlserver_10.3: The WebLogic Server home, which contains Java components, one Administration Server, and one or more Managed Servers.


oracle_home: The Oracle Home contains binary and library files for Oracle BI.


oracle_common: The Oracle Common Home contains the binary and library files required for Fusion Middleware Control and Java Required Files (JRF). There can be only one Oracle Common home within each Middleware home.


Typical Oracle Business Intelligence Directory Structure on a Single host with default values. At the top of the directory structure is the Middleware Home, which contains the Product Oracle Home, the Oracle Common Home, and the WebLogic Home. Notice the domains and instance directories are de-coupled from the MW_HOME and ORACLE_HOME.


Description of Figure 3-2 follows


Ref: Oracle Business Intelligence documentation


 


View the original article here

Obiee – How to mix string and number data type in one column and get a sum ?

Sometimes, you want to mix number and string data type in one column because you want to send a conditional message :


For instance, :
* if value > 1000, write “To Big” else value
* if value is null, write “No Data” else value


If you write a function, on this way as :


CASE WHEN Measures.”Count Passed” IS NULL THEN ‘No Data’ ELSE Measures.”Count Passed” END


You will have this error :


[nQSError: 10058] A general error has occurred. [nQSError: 22027] Union of non-compatible types. (HY000)
SQL Issued: SELECT “Business Rule”.”Rule Name”, CASE WHEN Measures.”Count Passed” IS NULL THEN ‘No Data’
ELSE Measures.”Count Passed” END, Measures.”Count Passed” FROM “MDM Vendor”
nQSError: 10058 A general error has occurred. nQSError: 22027 Union of non-compatible types. (HY000)


If you have already used a software as crystal report, you can’t mix of course two types of data in one field but you can have two fields one above the other. It’s why I have done in [[dat:obiee:presentation_service:obiee_character_number_in_one_column|this solution]].


But with [[language/css/start|css]], we can go further and have a single column.


How ?
* using the content property of [[language/css/start|css]]
* using the conditional formatting of OBIEE


===== The Content property of Css =====


The [[http://www.w3.org/TR/CSS21/generate.html#content|content]] property allow us to format an HTML element by adding an additional content (string, image, …) to a HTML element.


This property can not be use in an inline style such as :


This is a paragraph with the color blue



because it need a [[http://www.w3.org/TR/CSS21/generate.html#before-after-content|:before or :after pseudo-elements]].


We will therefore add two class in the OBIEE stylesheet.


===== How to add a custom class to the OBIEE Style Sheet =====


First, we will open the file custom.css and add this two class to demonstrate this capabilities.


/* This file is intentionally empty. Styles can be defined in a customized */
/* version of this file placed in the SiebelAnalyticsData/Web/Res folder; */
/* and can then be referenced from the “Custom CSS Style Options” area */
/* within some Siebel Answers Formatting Dialogs. These styles will only */
/* affect HTML content. */


td.ClassIsNull:before { content: “This value is null” }
td.ClassIsGreater:before { content: “This value is greater then zero : ” }


The custom.css file is located in a standard installation in the repertory :
Oracle_BiHomeoc4j_bij2eehomeapplicationsanalyticsanalyticsanalyticsRess_NewFrontiersb_mozilla_4


You can check its location with a right click on a OBIEE dashboardpage, select show source code and search “custom.css”.


In my dashboard, you can see below that the custom.css is located here :
* OBIEEAnalyticsWebSiteRoot/analyticsRes/s_NewFrontiers/b_mozilla_4/custom.css


===== Add a conditional formatting =====


Now that the worst is done, you can add a conditional formatting to the column in its property :


{{:dat:obiee:presentation_service:obiee_conditionnal_formating_class.jpg|}}


===== The Result =====


{{:dat:obiee:presentation_service:obiee_table_mix_number_string_sum.jpg|}}


This solution has one limitation, it works of course only in HTML.


 


View the original article here

Obiee – Period to period comparison with the analytical function Lag/Lead

During [[http://forums.oracle.com/forums/message.jspa?messageID=3403773#3403773|this thread]] on the Obiee forum, [[http://108obiee.blogspot.com/|Goran]] point out a solution for a period to period comparison with the analytical function lag. It was time for me to drill down in this analytical function and to compare it with the obiee time function : ago.


[[analytic:analytic_functions:analytic_function_lag|lag and lead]] are analytical functions that can be used to get the value of a column in a previous/next row. [[analytic:analytic_functions:analytic_function_lag|More ...]]


**Attention** : Your data must be [[analytic:dense_sparse|dense]] to have a correct result. See the paragraph [[#with_sparse_data|with sparse data]]. If you don’t have [[analytic:dense_sparse|dense]] data, you can always use the [[dat:obiee:presentation_service:obiee_period_to_period_ago_todate|Obiee Ago Function]]


===== Implementation =====
To implement this database function, we need to use the [[dat:obiee:bi_server:design:fact_table:obiee_embedded_database_function|evaluate functions]].


Create a presentation column in an answer (you can also create a logical column in the repository) and enter in the formula screen this code :


EVALUATE(‘LAG(%1,1) over (order by %2)’ as double, “Sales Facts”.”Amount Sold”, Calendar.”Calendar Month Desc”)


And if we select also form the SH schema, the calendar month desc and the amout sold, you obtain :


{{:dat:obiee:presentation_service:obiee_period_to_period_comparison_lag.jpg|}}


You can remark that you have an extra column “Moving sum”. This column contain this formula :


MSUM (“Sales Facts”.”Amount Sold”, 2) – “Sales Facts”.”Amount Sold”


And can be use to perform a period comparison but of course only for one interval. (2000-01 to 2000-02 but not 2000-01 to 2000-03)


===== Log / Performance =====


The total time to run this query is 10 second.


{{:dat:obiee:presentation_service:obiee_lag_log.jpg|}}


Much better than the [[dat:obiee:presentation_service:obiee_period_to_period_ago_todate|obiee ago function]] which perform the same statement in more than 1min36.


Why ? Because principally, Obiee send to the database only one query and don’t care of the [[#with_sparse_data|sparsity of the data]].



select distinct D1.c2 as c1,
D1.c1 as c2,
LAG(D1.c1,1) over (order by D1.c2) as c3
from
(select sum(T245.AMOUNT_SOLD) as c1,
T268.CALENDAR_MONTH_DESC as c2
from
SH.TIMES T268,
SH.SALES T245
where ( T245.TIME_ID = T268.TIME_ID and T268.CALENDAR_YEAR = 2000 )
group by T268.CALENDAR_MONTH_DESC
) D1
order by c1


===== With Sparse Data =====
I use the example of sparse data in this article [[analytic:dense_sparse]] where we would expect 22 rows of data (11 weeks each from 2 years) if the data were [[analytic:dense_sparse|dense]]. However we get only 18 rows because weeks 25 and 26 are missing in 2000, and weeks 26 and 28 in 2001.


And you can see that the lag column don’t give the good value for the previous period because the lag function don’t care about the time scale but the relative positions of year and week.


{{:dat:obiee:presentation_service:obiee_lag_with_sparse_data.jpg|}}


For information, the lag formula column :


EVALUATE(‘LAG(%1,1) over (order by %2, %3)’ as double, “Sales Facts”.”Amount Sold”,
Calendar.”Calendar Year”, Fiscal.”Fiscal Week Number”)


To fill the gap, you have to take the sparse data and do a partitioned outer join with a dense set of time data in SQL. (To know more [[http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14223/analysis.htm#i1014934|Data Densification for Reporting ...]]) and it’s not really realizable in OBIEE with the Business Model Layer, you have to deal with the [[dat:obiee:presentation_service:obiee_direct_database_request]]


 


View the original article here

Normalizing and loading Excel files using Informatica Powercenter

Sometimes it is a requirement where information is managed in so-called flat files (i.e.: .csv, .xls, etc) which are not user-friendly. The purpose of this article is to explain the process of loading such files in the data warehouse using informatica power center.


Scenario


A sample source file is shown below:


Clipboard01


And the expected result to be loaded into the DW is as below-


2


Solution


One possible way to achieve this is explained below –


In Excel


1 – Define a range in Excel selecting the following area (as can be seen below) and name this “Budget”


Clipboard03


In Windows


2 – Create an ODBC connection to the excel file where you defined the range in the previous point.


In Informatica Powercenter


3 – In Source Analyzer, import a table from the database choosing the ODBC connection defined in the previous point selecting the “Budget” table or the name given to the table in the point 1.


4 – Create a target table with the relevant target fields. Then in Target Designer, import the table where you want to load the data normalized. You can see a simplified version of the table below.


4


5 – In Mapping Designer, create a mapping which should look like the following.


Clipboard05


Tips:


– We’ll use just the first 13th port to link “Source Qualifier” and “Normalize” transformations. (From port called “Sales_Rep” to port called “Dec”, the columns that we want to load into the target table)


6 – Normalizing – Configuring the Transformation


As you can see in the snapshot, we have to create two ports inside the tab called “Normalizer”, one for the Sales Representative and the other for the Budgets.


6


Sales_Rep: is the first column that we have in the Excel file.


Budget: in the option called “occurs”, we have to divide it into 12 columns because it is the number of Budgets per year (monthly budget).


7


In the tab called “Ports” we can see that several ports were generated automatically.


8


7 – Configuring the “Expression”


We have to configure the expression as seen in the snapshot.


9


Tips:


Family_Group: a parameter has to be defined into the mapping, called $$Family and define it as Parameter type, because this mapping will be executed twice, but with different Families (Family1 & Family2)


GCID_Period_OUT: a new column with the following formula has to be created:


DECODE(GCID_Period_IN, 1,’Jan’, 2,’Feb’, 3,’Mar’, 4,’Apr’, 5,’May’, 6,’Jun’, 7,’Jul’, 8,’Aug’, 9,’Sep’, 10,’Oct’, 11,’Nov’,'Dec’)


The values that we have in GCID_Period_IN, is sequential beginning from 1 up to the total number of occurrences (in this case 12) defined in point 6 which are basically the number of months.


In Workflow Manager


8 – Configuring the workflow


As can be seen in the snapshot below, the same mapping will be executed twice, taking into account the following configurations.


10


Session Configurations:


The first session:


The Parameter Filename has to be set (paramfile_Family1.txt, which should be defined inside by the following parameter: $$Family = ‘Family1’


The second session:


Another Parameter Filename has to be set (paramfile_Family1.txt, which should be defined by the following parameters, $$Family = ‘Family2’ and VERY IMPORTANT, we have to override the SQL query into the session using the following:


text


11


Basically, you are changing the source columns to load into the second session, the Family2’s budget, as can be seen in the following diagram.


Clipboard012


 


View the original article here

Obiee – A special subject area to handle the dashboard parameters prompts


All the prompts in OBIEE are column based prompt. You can’t create a prompt if you don’t select a column. And as it’s the only way to set up a variable for a formula, it’s impossible to bypass this constraint.


In our case, we don’t care about the value in the dimension column as we want parameter values as for instance the hierarchy level :


{{:dat:obiee:presentation_service:obiee_parameter_prompt_result.jpg|}}


The idea behind the scene is :
– to create a column which is on the top of a dual view (or skinny table) in the physical layer.
– to create a dummy business model because BI Server requires us to have a minimal of one logical join.
– to create a special subject area (presentation catalogue) to separate the functional of the parameters columns
– to be able to choose this column in order to create one or several others parameter prompts.


The advantages of this solutions are that :
* as you query a skinny table (or dual view), the performance are very good
* as you use a column, you can translate in other languages the label of the parameter prompt
* you can add a parameter value without changing the original dashboard prompt


===== Creation of the Parameter Table =====


In this example, we show the creation of a parameter table with a dual view but you can choose to create a table to store your parameters.


* In the physical layer, right click on a physical schema and choose New Physical Table
* select “Select” as Table Type from the drop down menu
* and enter the Sql below


Example :


SELECT ‘MONTH’ AS REPORT_LEVEL FROM DUAL
UNION
SELECT ‘QUARTER’ AS REPORT_LEVEL FROM DUAL


{{:dat:obiee:presentation_service:obiee_dummy_table.jpg|}}


Second, you need to create the column report_level from the sql statement.
* click on the column tab and create it


{{:dat:obiee:presentation_service:obiee_dummy_table_columns.jpg|}}


If you choose this column in a query, the values MONTH and QUARTER will be returned.


===== Creation of the Business Model Layer =====
* Drag and drop **TWO** times this table in order to create two logical table source :
* Parameters1
* Parameters2
* Select this two tables,
* Right click / Business Model Diagramm / Selected Tables only
{{:dat:obiee:presentation_service:obiee_dummy_business_model.jpg|}}
* and create a new complex join between them.
{{:dat:obiee:presentation_service:obiee_dummy_model_2.jpg|}}


This step is important beacause Obiee require that a fact table has minimum one complex logical join


===== Creation of the Presentation Catalog =====
* Right click in the presentation layer / New Presentation Catalog and name it Parameter
* Just drag and drop one of the two logical table and you are done.
* You can cache this new presentation catalog to the others users by giving the correct privilege. In the Oracle BI Presentation Dashboard / Administration / Manage Privileges.
* Reload the metadata in the BI Presentation Dashboard in Administration / Reload Files and metadata


{{:dat:obiee:presentation_service:obiee_parameter_subject_privilege.jpg|}}


In the picture above, you can see that only the Presentation Server Administrator have the right to the Parameter Area but everybody can use a object (report, prompt) create with it


===== Creation of the dashboard prompt =====


Now that we have our parameter column in our parameter subject area, it’s possible to choose it in order to create a parameter prompt.


* Go to answer
* Click on the icon : New Dashboard prompt on the left side
* And select the subject area Parameter
{{:dat:obiee:presentation_service:obiee_new_dashboard_prompt.jpg|}}
* in the left frame, select the column of the select table (in our case report_level)
* and define the options that you need as the setting of a presentation variable
{{:dat:obiee:presentation_service:obiee_parameter_prompt.jpg|}}
* and you get :
{{:dat:obiee:presentation_service:obiee_parameter_prompt_result.jpg|}}


===== What about now if I don’t want MONTH and QUARTER but MONTH and YEAR ? =====


You can change the values in your parameter table or you can use the SQL value capabilities of the prompt :
* Go back to your prompt
* select SQL Value in the show result
* and tape this SQL :


SELECT CASE WHEN 1=0 THEN Parameters.REPORT_LEVEL ELSE ‘MONTH’ END FROM Parameter
UNION
SELECT CASE WHEN 1=0 THEN Parameters.REPORT_LEVEL ELSE ‘YEAR’ END FROM Parameter


As one is always different of zero, you will obtain MONTH and YEAR as value in the drop down list.


You can not enter this SQL :


SELECT ‘MONTH’ FROM Parameter
UNION
SELECT ‘YEAR’ FROM Parameter


because Parameter describe a presentation catalog and not a table. In the Sql of OBIEE, you really need to have for each column the name of the table otherwise you will obtain this error :


Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred.
[nQSError: 42021] The query does not reference any tables. (HY000)
SQL Issued: SELECT ‘MONTH’ FROM Parameter


===== Performance =====
As we use a dual or a skinny table as source table, the performance are really good.


===== Conclusion =====
You can add to your parameter subject area one column by parameter or you can change the values with the SQL capabilities from the prompt. In the two case, a sql statement against a little table of Oracle is performed and doesn’t therefore require to read data by an I/O operation on a disk. You can therefore choose your preferred solution but keep in mind that one column for one dashboard prompt is the natural Obiee mechanism and permit a good translation in other languages.


 


View the original article here