obiee- variables

20
VARIABLES 1 VARIABLES Variables contain values in memory that are used by Oracle BI Server during its processing. Variables are useful to store any one value. Variables are created and managed using the Variable Manager feature in the Administration Tool. Variable Manager Variable manager is a utility in the Administration Tool that is used to define variables. Select Manage > Variables to access the Variable Manager The Variable Manager Dialog box has two panes. The left pane displays a tree that shows variables and initialization blocks, and the right pane displays details of the item you select in the left pane. The left pane is divided into repository variables and initialization blocks, and session variables and initialization blocks. 165

Upload: venkateshgolla

Post on 21-Jan-2016

245 views

Category:

Documents


1 download

DESCRIPTION

OBIEE - Varibles and their setup

TRANSCRIPT

Page 1: OBiee- Variables

VARIABLES

 

  1 

VARIABLES • Variables contain values in memory that are used by Oracle BI Server during its processing.

Variables are useful to store any one value. • Variables are created and managed using the Variable Manager feature in the Administration Tool.  Variable Manager • Variable manager is a utility in the Administration Tool that is used to define variables.

• Select Manage > Variables to access the Variable Manager • The Variable Manager Dialog box has two panes. The left pane displays a tree that shows variables

and initialization blocks, and the right pane displays details of the item you select in the left pane. The left pane is divided into repository variables and initialization blocks, and session variables and initialization blocks.

165

Page 2: OBiee- Variables

VARIABLES

 

  2 

Variable Types • Variable are divided into 3 types

1. Repository variables 2. Session variables 3. Presentation variables 

• Repository and Session variables are defined using the Variable Manager in the Administration Tool. These variables can be used in the repository and presentation catalog.

• RPD Variables (Repository and Session) will be defined in rpd and can be utilized in rpd calculations, securities, presentation services, reporting calculations and reporting filters.

• Presentation variables are defined and used in the presentation catalog

      Static 

1.Repository Dynamic RPD Level 2.Session System

Variables Non-System Presentation 3.Presentation Services (or) Report Level Request

 

1. Repository Variables

• A repository variable has a single value at any point in time. • Repository variables can be used instead of literals or constants in the Expression Builder in the

Administration Tool. Oracle BI Server will substitute the value of the repository variable for the variable itself in the metadata.

• Persist from the time Oracle BI Server is started until it is shut down. It will be loaded whenever we refresh, Oracle BI server.

• Repository Variables are also called as Server variables • Repository variables are represented by a question mark icon. • Syntax of Repository Variable is

o VALUEOF (“Variable_name”) o Ex: Valueof (“Deptno”)

• There are two types of repository variables: a) Static Repository Variable b) Dynamic Repository Variable

166

Page 3: OBiee- Variables

VARIABLES

 

  3 

a) Static Repository Variables • The value of Static repository variable is constant throughout the life of OBI. • The value of a static repository value is initialized in the Default Initializer field in the Static

Repository Variable dialog box. • This value does not change until an Oracle BI Server administrator decides to change it. • Values are initialized once and remain constant. • Scenario: If we want to use a Static value in multiple places then we will go for Static repository

variable. Process:

In the rpd go to Manage > Variables In Variable Manager Select Action > New > Repository > Variable

Or Select Repository > Variables > Static in the left pane. Right-click in the right pane and select

New Repository Variable. Select Radio button Type as Static Give a name to the Static variable (in the example ‘Deptno10’). Enter variable values in the

‘Default Initializer’ dialog box.

167

Page 4: OBiee- Variables

VARIABLES

 

  4 

b) Dynamic Repository Variable • The value of the Dynamic repository variable will be refreshed or changed by data returned from

queries in Initialization blocks. • A SQL query is called as ‘Initialization block’. • Dynamic repository variable values change according to the refresh schedule. Only Dynamic

repository variable Initialization block can be scheduled. • When the value of a dynamic repository variable changes, all cache entries associated with a business

model that reference the value of that variable are purged automatically. • Scenario: A common use of these variables in Answers is to set column filters. For example, to filter

a column on the value of the dynamic repository variable CurrentMonth, set the filter to the variable CurrentMonth.

Process:

In Variable Manager Select Action > New > Repository > Variable Select Type as Dynamic Give a name to the Static variable (in the example ‘MaxDeptno’). Create a new ‘Initialization Block’ or select from already created one.

Session Variables

• Session variables are created and assigned a value when each user logs on. • Logout minus login time of user is called as session. Any application will support multiple sessions

at a given point of time. • A session is an instance of a user running the client application. The session starts when a user opens

the application and ends when the user closes it. • Session variables obtain their values from initialization blocks. • The initialization of session variables is not scheduled like dynamic repository variable. • Session Variables are represented by a question mark icon. • Syntax from Session Variable is

o VALUEOF (NQ_SESSION.”Variablename”) • There are two types of session variables: system and non-system.

a) System Session Variable b) Non-System Session Variable

168

Page 5: OBiee- Variables

VARIABLES

 

  5 

a) System Session Variable • System Session Variables will be created with the installation of OBIEE. • System Session Variables are predefined session variables that are used by the Oracle BI Server for

specific purposes • System Session Variables have reserved names, which cannot be used for other kinds of variables • Scenario: System session variables are primarily used when authenticating users against external

sources such as database tables or Lightweight Directory Access Protocol (LDAP) servers.

• An example is USER, which holds the value the user entered as his or her logon name. Another

example is GROUP, which contains the group that a user belongs to. • Example: USER holds the value the user entered for logon name b) Non-System Session Variables • Non-System Session Variables are customized application variables, these variables are also required

Initialization blocks. • Non-system session variables can be created by the Administrator to serve a purpose for a specific

application. • A common use for non-system session variables is setting user filters. • Example: Capture the user’s region and limit the records the user sees to only those for that region Process:

In the rpd go to Manage > Variables In Variable Manager Select Action > New > Session > Variable

Or Select Session > Variables > Non-System in the left pane. Right-click in the right pane and

select New Session Variable. Give a name to the Non-System Session Variable(in the example ‘UserRegion’)

169

Page 6: OBiee- Variables

VARIABLES

 

  6 

Create a new ‘Initialization Block’ or select from already created one.

Initialization Block

• A SQL query is called as ‘Initialization block’. • Initialization blocks are used to initialize dynamic repository variables, system session variables, and

non-system session variables. • The icon for an initialization block is a cube labeled “i.” • Initialization Block specifies SQL to be run to populate one or more variables by accessing data

sources.

170

Page 7: OBiee- Variables

VARIABLES

 

  7 

• An initialization block contains the SQL that is executed to initialize or refresh the variables associated with that block.

• Initialization blocks are invoked at Oracle BI Server startup and are periodically rerun to refresh values for dynamic variables according to an established schedule.

Process:

i) Creating Initialization Block for Repository Variable Repository Variable Init Block Window

In Variable Manager Select Action > New > Repository > Initialization Block (For Repository Variables).

Give a name to the Repository Variable Init Blcok (in the example ‘LatestJoinedEmployee’). Schedule the Init Block ‘Refresh Intervel’, to schedule (in the example ‘refresh for every day’) Select ‘Edit Data Source’, the data source is to identify the data source through connection pool.

171

Page 8: OBiee- Variables

VARIABLES

 

  8 

Edit Data Source: Select Edit Data source in the Repository variable Init Block window Enter a default query or enter the query using database-specific SQL. The SQL must reference

physical tables that can be accessed using the connection pool specified in the Connection Pool field.

If you want the query for an initialization block to have database specific SQL, you can select a database type for that query.

Click the Test button to test the query. Click the Browse button to select the connection pool

Edit Data Target:

Select ‘Edit Data Target’ in the Repository variable Init Block window Here we are assigning the Variables for the created Init Block. Here we can create new variables, Remove and Edit variables which are already created. Use Up and Down buttons to rearrange variable order. The order of the variables must match the

order of the corresponding columns in the initialization block SQL query.

172

Page 9: OBiee- Variables

VARIABLES

 

  9 

ii) Creating Initialization Block for Session Variable

In Variable Manager Select Action > New > Session > Initialization Block (For Session Variables).

The process of creating initialization block for session variable is same as initialization block for repository variable.

There were mainly 2 differences The initialization of session variables is not scheduled like dynamic repository variables, so

Schedule column is not available for Session variables. Request for Authentication check box available

173

Page 10: OBiee- Variables

VARIABLES

 

  10 

Row-wise Initialization Blocks • The row-wise initialization option allows you to create session variables dynamically and set their

values when a session begins. • The names and values of the session variables reside in an external database that you access through a

connection pool. • The variables receive their values from the initialization string that you type in the Initialization Block

dialog box. • For example, you want to create session variables using values contained in a table named

RW_SESSION_VARS. The table contains three columns: USERID, containing values that represent users' unique identifiers; NAME, containing values that represent session variable names; and VALUE, containing values that represent session variable values.

174

Page 11: OBiee- Variables

VARIABLES

 

  11 

The content of the table is as follows:

USERID NAME VALUE

JOHN LEVEL 4

JOHN STATUS FULL-TIME

JANE LEVEL 8

JANE STATUS FULL-TIME

JANE GRADE AAA

• You create an initialization block and select the Row-wise initialization check

box. • For the initialization string, you type the following SQL statement:

select NAME, VALUE from RW_SESSION_VARS where USERID='VALUEOF(NQ_SESSION.USERID)' NQ_SESSION.USERID has already been initialized using another initialization block.

• The following session variables are created: o When John connects to the Oracle BI Server, his session will contain two session

variables from row-wise initialization: LEVEL, containing the value 4; and STATUS, containing the value FULL_TIME.

o When Jane connects to the Oracle BI Server, her session will contain three session variables from row-wise initialization: LEVEL, containing the value 8; STATUS, containing the value FULL-TIME; and GRADE, containing the value AAA.

175

Page 12: OBiee- Variables

VARIABLES

 

  12 

Using Variables

RPD variables (Repository and Session) variables are used in RPD calculations, securities, presentation services, reporting calculations and reporting filers. The following are some examples. Usage1: Using Expression Builder. Repository and Session variables are available in the Expression Builder. Which can be used for creating logical columns, rpd calculations etc.

Usage2: We can Implement Data level security by using system, non-system session variables.

176

Page 13: OBiee- Variables

VARIABLES

 

  13 

Usage3: Using Variables in Presentation Services We can use variables in presentation services while creating filters

177

Page 14: OBiee- Variables

VARIABLES

 

  14 

Report Variables or Presentation Service Variables

In report level we have 2 types of variables. These variables are defined in Dashboard prompt and can be utilized in report filters, titles, ticker view, narrative view, and report level calculations.

a) Presentation Variable b) Request Variable

Presentation Variable • Presentation variables are declared in a dashboard prompt, using the Set Variable value in Dashboard

prompt. • Presentation Variable is useful to capture dashboard prompt values and these values can be utilized in

a filter, in calculation, narrative view, ticker, title of the request.

Process: Develop a report by using presentation variable as a filter of the report

In a Dashboard prompt select Set Variable as ‘Presentation Variable’. (‘city’ is the variable in this example)

The control of the prompt column should be either drop-down list or edit box. Presentation variables are initialized with the default values set for the prompt columns, select

Specific Value in Default to and set a default value. (Chicago in this example)

Presentation variables get their values when user selects a value from the drop-down list or when

the user enters a value in the edit box. For the ‘Emp Location’ request we should assign ‘city’ filter.

178

Page 15: OBiee- Variables

VARIABLES

 

  15 

Presentation variable using in Title Process: • Presentation variables can be referenced in

Title views Narrative views Column filters Column formula Conditional formatting conditions

• Presentation Variables are referenced using the syntax - @{variablename}{<value>}[format] Variablename – name of the presentation variable Value – Default value to be used if the variable referenced by the variablename is not populated Format – a format mask dependent on the data type of the variable

o Example - #, ##0, MM/DD/YY hh:mm:ss , and so on

179

Page 16: OBiee- Variables

VARIABLES

 

  16 

Request Variable • Request variable is useful to overwrite ‘Session variable’ values. • The value entered by a user in a dashboard prompt can be set to a session variable • We will define session variable in Dash board prompt. While we were defining, whatever session

variable we want to overwrite that session variable name we need to give. • For example if the user ‘Kiran’ belongs to Middle East region and if we given Request variable =

‘Region’ (Region session variable is created in rpd which the user Kiran belongs to Middle East) • User entered value will explicitly override the variable value set via initialization block

180

Page 17: OBiee- Variables

VARIABLES

 

  17 

Best Practices

• Variables contain values in memory that are used by the Oracle BI Server during its processing • There are 3 types of variables – Session, Repository and Presentation variables • Session variable values are specific to a user’s session and is active only till the user’s session is

active • Repository variables are initialized when the server starts and is active until the server shut down • Row-wise initialization blocks are used to create dynamic session variables that can hold a list of

values • Presentation variables are declared in a dashboard prompt and can be used to dynamically change the

title view, narrative view, column filters, column formula and conditional formatting conditions • Request variables are used to change the value of session variables based on user selection in a

dashboard prompt

FAQ’s

Question: What is variable in terms of OBIEE repository? Ans: OBIEE uses the variable as they are in any programming language to store value in the memory. Question: What type of variable supported by Obiee and describes them in detail? Ans: Variable type details Repository Variables: Repository variables are created to use in the expressions that is part of meta data modeling. Scope of the repository variable is global. Session Variable: Scope of the Session Variable is pertain to a user’s login session and available both in SAS Repository and web client application Question: What types of session variable are available? Ans: System: System session variables are pre-declared one. Bi server does NOT allow to create a new system session variable. Only pre-declared session variables can be used. Initialization Block value of the system session variables is not changed during a user session. Ex: USER, GROUP, WEBGROUPS, LOGLEVEL. Non-System: Non-System session variables are created based on the need. It must be assigned to an Initialization Block. Value of Non system session variable remains same during a user session. Ex: SV_POSITION_ID, SV_ORG_ID Question: What is Initialization Block? Ans: Initialization Block is a routine pre-defined in the repository to initialize/refresh dynamic repository variable and session variables. Ex: IB_SET_CURRENT_PERIOD (Refreshed for once a day) IB_GET_USER_DETAILS Initialization block can be scheduled to refresh dynamic repository variables. Question: What is the significance of Row-Wise Initialization? Ans: This feature enables to initialize system session values from the database table (i.e. both variable name and its values are retrieved from database). Also this feature can be used to initialize a variable with list of values (i.e. more than 1 value). These variables can be used in the set operation of SQL. (Used in conjunction with IN clause of SQL). This feature is available only for session variable. Question: What is the syntax to use variables in the expressions? Ans: VALUEOF(<RepositoryVariable>). VALUEOF(NQ_SESSION.<SessionVariable>).

181

Page 18: OBiee- Variables

VARIABLES

 

  18 

Question: What is the impact when a dynamic repository variable is refreshed automatically? Ans: All Cache entries associated with that variable in a business model will be purged automatically. Question: How are the repository and session variable values retrieved? Question: What are the different types of session variables? Ans: Persist only while a user’s session is active. Receive values when users establish their sessions. Consists of two types

System Non-System

Question: Mention some of the system session variables Ans: USER, GROUP, WEBGROUPS, LOGLEVEL Question: What is the use of row-wise initialization blocks? Ans: Row-wise initialization blocks are used to create dynamic session variables that can hold a list of values Question: How are values assigned to the presentation variables? Ans: Presentation variables are declared in a dashboard prompt and can be used to dynamically change the title view, narrative view, column filters, column formula and conditional formatting conditions

Question: What is a request variable? Ans: Request variables are used to change the value of session variables based on user selection in a dashboard prompt Question: What is variable in Siebel? Ans: You can use variables in a repository to streamline administrative tasks and modify metadata content dynamically to adjust to a changing data environment. The Administration Tool includes a Variable Manager for defining variables Question: What types of variable we find in OBIIE? Ans: Two types exist and these are the repository variables and session variables. The first kind remains the same anytime and gives birth to other two types: static and dynamic. The static variable changes only when the Siebel Analytics Server administrator wants to make a change. The dynamic variable updates every time a query is executed by a schedule from the Siebel Analytics Server. The second type (session variables) received a new value every time a user is logging on and this second type also splits into other two subtypes: system and non-system. Question: What are the different types of variables in OBIEE? Explain? Ans: There are two types of variables in OBIEE.

a. Repository variable: This variable is for the whole repository. b. Session variable: Session variable can be system variable and non system variable. System

variable uses NQ_SESSION. —- (system reserved variable). Examples of non system variables are user defined filters etc. Question: What are different types of variables? Explain each? Ans: There are two classes of variables:

1. Repository variables 2. Session variables. Repository variables: A repository variable has a single value at any point in time. There are two

types of repository variables: -Static: This value persists, and does not change until a Siebel Analytics Server administrator

decides to change it.

182

Page 19: OBiee- Variables

VARIABLES

 

  19 

-Dynamic: The values are refreshed by data returned from queries. When defining a dynamic repository variable, you will create an initialization block or use a preexisting one that contains a SQL query. You will also set up a schedule that the Siebel Analytics Server will follow to execute the query and periodically refresh the value of the variable. Session Variables:

Session variables are created and assigned a value when each user logs on. There are two types of session variables: 1.System 2.Nonsystem. Question: What is static and dynamic variable? When does these variables get refresh? Question: How will affect the changes for a report, if for certain users only the column heading in the report should be changed? Ans: Using session variables for that user. Question: What is system variable and non system variable? Ans: System variables:

System variables are session variables that the Siebel Analytics Server and Siebel Analytics Web use for specific purposes. System variables have reserved names, which cannot be used for other kinds of variables (such as static or dynamic repository variables, or for non-system session variables).

When using these variables in the Web, preface their names with NQ_SESSION. For example, to filter a column on the value of the variable LOGLEVEL set the filter to the Variable NQ_SESSION.LOGLEVEL. Non-system variables:

A common use for non-system session variables is setting user filters. For example, you could define a non-system variable called Sales Region that would be initialized to the name of the user’s sales region. You could then set a security filter for all members of a group that would allow them to see only data pertinent to their region.

When using these variables in the Web, preface their names with NQ_SESSION. For example, to filter a column on the value of the variable Sales Region set the filter to the Variable NQ_SESSION.SalesRegion.

Question: Can we tell the difference between a system and a non system variable? Ans: Yes, for example system variables are those session variables used by Siebel Analytics Web and Sever and they we can’t use them for static variables, dynamic repository or non system session variables. On the other hand non system variables or non system session variables can be used as a filter for users. Question: What is System session Variable in the Repository? Question: What is system session variable? When does it get initialized? Question: Do you know about Initialization Blocks? Can you give me an example where you used them? Ans: o Init blocks are used for instantiating a session when a user logs in.

o To create dynamic variable you have to create IB to write SQL statement Question: What is Presentation Variable and uses? Ans: • Presentation variables are declared in a dashboard prompt

o Using the Set Variable value • The control of the prompt column should be either drop-down list or a edit box • Presentation variables are initialized with the default values set for the prompt columns. • Assigning values - Presentation variables get their values when user selects a value from the drop-

down list or when the user enters a value in the edit box

183

Page 20: OBiee- Variables

VARIABLES

 

  20 

• Using Presentation variable – Variables can be referred in Title views Narrative views Column filters Column formula Conditional formatting conditions

Question: How are values assigned to the presentation variables? Ans: Presentation Variables are referenced using the syntax - @{variablename}{<value>}[format] Question: I want to store the value of the last time the repository was updated and show it in the dashboard? What type of variable can be used for this purpose? Ans: Question: Is there any way to see a list of all the repository variables defined in your repository using Answers tool? Ans:

184