OBIEE – Creating and using dynamic repository variable

We will create and use a dynamic repository variable in the dashboard. The aim is to show current time in the dashboard.
We use the variable in two places. First is in the title of a report

The second is in the narrative text.

Steps:
1. Create a dynamic repository variable that obtains the latest time. we will need to write an initialization block to get initialize and update this variable. To create the variable
a. In the Administration tool. click on Manage-> variables.
b. Click on Action-> New -> Repository -> Variable.
c. Give ‘Date’ as the name of the variable. Select the radio button that says ‘Dynamic’ . The Initialization block variable drop down will be enabled.
d. In the initialization block variable click on New. A window for creating a new initialization block opens.
e. Write ‘CurrentTime’ as the name of the block. refresh interval one minute. start on – leave default.
f. click on edit datasource and enter the following query (MySql)
SELECT DATE_FORMAT(now(),’%a %D %b %Y %H:%i %p’);
g. click on browse button near the ‘Connection pool’ and select the foodmart connection pool.

h. click on ‘Test’.Results should show the current time.
i. click on OK.
j. in the initialization dialog. click on edit data target. Select the Date variable and click on OK.
h. close the initialization dialog by clicking OK.
i. close the dynamic repository dialog by clicking OK.

We have now created a repository variable that obtains the current time from the database every minute.
Check in the changes.

2. Open the Dashboard Page.
3. To add this variable to a title (e.g “Units Ordered”). Click on the rename button on the title and change the title to
Units Ordered -@{biServer.variables[‘Date’]}
4. 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
The current time is [b]@{biServer.variables[‘Date’]}[/b]

This completes the tutorial

1 thought on “OBIEE – Creating and using dynamic repository variable”

Leave a Comment