Top Banner

of 24

52973138 Variables in Obiee

Apr 06, 2018

Download

Documents

yaseennawaz
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/2/2019 52973138 Variables in Obiee

    1/24

    VARIABLES IN OBIEE

    OBIEE offers 3 types of variables:

    1. Repository variable2. Session variable3. Presentation variable

    REPOSITORY VARIABLE:

    A repository variable is a BI server variable that doesn't depend of the user (then of the login

    process). You have two kind of repository variable :

    y Static (of a constant)y Dynamic (which is calculated/refresh periodically).

    DYNAMIC REPOSITORY VARIABLE:

    When the value of a dynamic repository variable changes, all cache entries associated with a

    business model that reference the value of that variable will be purged automatically.

    Steps:

    Create a dynamic repository variable that obtains the minimum year. We will need to write an

    initialization block to get initialize and update this variable.

    1. In the Administration tool. Click on Manage-> variables.

  • 8/2/2019 52973138 Variables in Obiee

    2/24

    2. Click on Action-> New -> Repository -> Variable.

    3. Give 'MinYear' as the name of the variable. Select the radio button that says Dynamic. The

    Initialization block variable drop down will be enabled.

    4. In the initialization block variable click on New. A window for creating a new initialization

    block opens.

  • 8/2/2019 52973138 Variables in Obiee

    3/24

    5. Write 'MinYearInit' as the name of the block. Refresh interval one minute. Start on - leave

    default.

    6. Click on edit datasource and enter the following query :

    SELECT MIN(CALENDAR_YEAR) FROM TIMES

  • 8/2/2019 52973138 Variables in Obiee

    4/24

    7. Click on browse button near the 'Connection pool' and select the connection pool.

    8. Click on 'Test'. Results should show the minimum year.

    9. Click on OK.

  • 8/2/2019 52973138 Variables in Obiee

    5/24

    10. In the initialization dialog, click on edit data target. Select the MinYear variable and click on

    OK.

    11. Close the initialization dialog by clicking OK.

    12. Close the dynamic repository dialog by clicking OK.

  • 8/2/2019 52973138 Variables in Obiee

    6/24

    We have now created a repository variable that obtains the minimum year from the database.

    Check in the changes.

    13. Open the Presentation services.

    14. To add the variable to a narrative text, add the text dashboard object to the dashboard. click

    on properties of the text object and write

    [b]Minimum Year- @{biServer.variables['MinYear']}[/b]

    The output will be :

  • 8/2/2019 52973138 Variables in Obiee

    7/24

    STATIC REPOSITORY VARIABLE:

    The value of a static repository value is initialized in the Variable dialog box. This value persists,

    and does not change until an Oracle BI Administrator decides to change it.

    Example:

    Suppose you want to create an expression that displays the default year 2000 for certainproducts.Rather than entering the number 200 in this expression as constant, you could use theVariable tab of the Variable dialog box to set up a static repository variable named def_year and

    initialize it to a value of 2000.

    Steps:

    Create a static repository variable to store the default year. We will need to write an initialization

    block to get initialize and update this variable.

    1. In the Administration tool. Click on Manage-> variables.

    2. Click on Action-> New -> Repository -> Variable.

  • 8/2/2019 52973138 Variables in Obiee

    8/24

    3. Give 'def_year' as the name of the variable. Select the radio button that says Static.

    4. In the default initializer , enter the value 2000.

    5. Close the dynamic repository dialog by clicking OK.

  • 8/2/2019 52973138 Variables in Obiee

    9/24

    We have now created a repository variable that stores the minimum year from the database.

    Check in the changes.

    13. Open the Presentation services.

    14. To add the variable to a narrative text, add the text dashboard object to the dashboard. Click

    on properties of the text object and write

    [b]Default Year- @{biServer.variables['def_year']}[/b]

    The output will be :

  • 8/2/2019 52973138 Variables in Obiee

    10/24

    Even you can use this static variable in expressions created using expression builder in rpd.

  • 8/2/2019 52973138 Variables in Obiee

    11/24

    SESSION VARIABLES:

    Session Variable are the second type of variable and depend of the user. When the users log in

    BI Presentation Service, they are initialized. You have two kind of session variable:

    1. Session System:

    System session variables are session variables that the Oracle BI Server and Oracle BIPresentation Services use for specific purposes. System session variables have reserved names,

    that cannot be used for other kinds of variables (such as static or dynamic repository variable

    and nonsystem session variables).

    2. Session Non System:

    Session Non System variable are variable that you can create for your own purpose.

    Example:

    Suppose if you want to display the name of that customer alone who logged into the

    presentation services using his first name. This is a type of datalevel security.

    Steps:

    Create a session variable to store the details of the users logging into the presentation services.

    We will need to write an initialization block to get initialize and update this variable.

    1. In the Administration tool. Click on Manage-> variables.

  • 8/2/2019 52973138 Variables in Obiee

    12/24

    2. Click on Action-> New -> Session-> Variable.

    3. Give USER' as the name of the variable. The Initialization block variable drop down will be

    enabled. In the initialization block variable click on New.

  • 8/2/2019 52973138 Variables in Obiee

    13/24

    4. A window for creating a new initialization block opens. Write 'setUser' as the name of the

    block.

    5. Click on edit datasource and enter the following query:

    SELECT ':USER FROM CUSTOMERS WHERE CUST_FIRST_NAME=':USER'

  • 8/2/2019 52973138 Variables in Obiee

    14/24

    6. Click on browse button near the 'Connection pool' and select the connection pool. Click OK.

    7. In the initialization dialog, click on edit data target. Select the USER variable and click OK.

  • 8/2/2019 52973138 Variables in Obiee

    15/24

    11. Close the initialization dialog by clicking OK.

    12. One Dialog box opens and aska for YES or NO. Click YES and close the session variable

    dialog

  • 8/2/2019 52973138 Variables in Obiee

    16/24

    13. In the BMM layer, open the LTS of COUNTRIES table. Click on the content tab.

    14. In the WHERE clause filter, give the following statement:

    sh."".SH.CUSTOMERS.CUST_FIRST_NAME = VALUEOF(NQ_SESSION."USER") OR

    VALUEOF(NQ_SESSION."USER") = 'Administrator'

  • 8/2/2019 52973138 Variables in Obiee

    17/24

    15. Click ok. Check in the changes. Restart the services.

    16. Log in the presentation services using any of the customer first names (e.g. Abel)

    17. In Answers, in the criteria tab select CUST_FIRST_NAME and display the result.

  • 8/2/2019 52973138 Variables in Obiee

    18/24

    PRESENTATION VARIABLE:

    The presentation variable is the only variable offer by the presentation service. You can set it

    with the help of the dash board prompt which will then take the data type of the presentation

    column.

    The syntax of presentation variable is@{variables.}{}[format]

    Steps:

    1. Go to the Criteria tab ofAnswers in presentation services.Select the Calendar Year, Country,

    Products, Sales Facts

    2. Display the results. In the result tab, drill down the list and Select the Title.

  • 8/2/2019 52973138 Variables in Obiee

    19/24

    3. Give the Syntax on Title Box

    Country Is: @{Country}

    Give the Syntax on Subtitle

    Year is :@{Year}

    4. Select the compound layout

  • 8/2/2019 52973138 Variables in Obiee

    20/24

    5. Go to criteria tab. Click add filter button in CALENDAR_YEAR. Select the is prompted option.

    Click on OK.

    6. Do the same for COUNTRY_NAME .

  • 8/2/2019 52973138 Variables in Obiee

    21/24

    7. Save the request.

    8. Click the new dashboard prompt. Select the SH subject area.

  • 8/2/2019 52973138 Variables in Obiee

    22/24

    9.Right Side select the Calendar Year.

    10. Open set variable drill down list and select the Presentation variable.

  • 8/2/2019 52973138 Variables in Obiee

    23/24

    11.Given the Year on presentation variable.

    12.Do the same for the COUNTRY_NAME.

    13.Save the Prompts.

  • 8/2/2019 52973138 Variables in Obiee

    24/24

    14.Select the Dashboard and click the page Option.Edit Dashboard and select Saved Promptand the request.

    15. Select the year and country and click on GO.