Using Repository Variables in Conditional Formatting in OBIEE 11G Reports

Using Variables in Conditional formatting in OBIEE  11G
You can reference variables in several areas of Oracle BI Enterprise Edition, including in analyses, dashboards, KPIs, agents,filters and conditional formatting. There are two types of variables that you can be created through RPD :
  • Session
  • Repository
Session Variables
A session variable is a variable that is initialized at login time for each user. When a user begins a session, the Oracle BI Server creates a new instance of a session variable and initializes it.
There are two types of session variables:
  • System — A session variable that the Oracle BI Server and Oracle BI Presentation 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 variables and non-system session variables).
  • Non-system — A system variable that the administrator creates and names. For example, the administrator might create a SalesRegion non-system variable that initializes the name of a user’s sales region.
The administrator creates non-system session variables using the Oracle BI Administration Tool.
Repository Variables
A repository variable is a variable that has a single value at any point in time.
There are two types of repository variables:
  • Static — Repository variables whose value persist and do not change until the administrator decides to change them.
  • Dynamic — Repository variables whose values are refreshed by data returned from queries.
The administrator creates repository variables using the Oracle BI Administration Tool.
Syntax for using Repository variable in Conditional Formatting:

We have a reporting requirement where the Client wants conditional Formatting to be maintained from DB / RPD. So we tried lot of ways using dynamic filters, BINS but nothing worked out. Then we made a way by creating CASE statements and then utilizing its value in Conditional Formatting.

1)    Repository Variables are defined using the Variable Manager within the Oracle BI Administrator (Manage> Variables).

2)    Create a Dynamic variable and a INIT block in RPD

Now we have 4 Dynamic variables seen above. 
3)    We planned to have conditional formatting  using 2 values as below in Answers Page, Column Threshold_value (column -> Edit Properties-> Formula) :
Case when Threshold_value < 143.1_low then 0 When  (Threshold_value >= 143.1_low and Threshold_value < 143.1_high) then 1 Else 2  END
4)    Then go to same column-> Column properties-> Conditional Formatting
Add condition on column “ Threshold_Value” as :
Threshold_value = 1 , and in formatting set color = Red
Threshold_value=2 , and set color = Yellow.