Thursday, December 6, 2012

OBIEE and Narrative - introduction, in English

One of the least used options in OBIEE is the Narrative.

Narrative has 6 parts:
1. The "Contains HTML Markup", which is self explanatory.
2. Prefix, that has code/text that comes before any row of your data.
3. Narrative, is the text that is run for each row of your data.
4. Row separator, that comes between Narrative lines.
5. Rows to display, that controls the number of rows from Narrative to use. Very ofter 1 is used here. Please note the default is 30. 
6. Postfix, that has code/text that comes after all rows of your data.

The major difference is between "Narrative" and "Row Separator" that  are repeated for each row of the analysis data and "Prefix" and "Postfix" that are used only once.
There are many interesting cases to use Narrative. In the following posts we will discuss graphical tiles (like the above one), Google Charts and maybe few more cases.

In the Narrative section you can add column values and Variables.

To add a Value you should write @N where N is the number of the column in the criteria, from left to right, starting 1.
For example to get the value of second column in a Narrative you should use @2.

Variables are similar, for example to add a presentation variable use @{Presentation Variable} in the Narrative.

So lets have a basic example:

I have an analysis with 3 columns:

Product Type, a Calculated Color name based on the Value of revenue and a Revenue.
I added a descending sort on Revenue.
I add a Narrative:
In the Narrative I wrote Top 5 Products in the prefix, then pressed the "Line Break" button two times. Marked the entire sentence and pressed on B and u buttons. I can see the result at the bottom of the screen: Top 5 Products
Since I wanted top 5 I wrote 5 in the Rows to display. It will be actually top 5 due to the sorting on Revenue.

Now I added the values for each row:
@1 revenue was @3.
 Pressed "Line Break" button, since I don't want all values in one long line.

Please note, this is not HTML Markup yet.

The result was:

But wait, the actual result on the screen is Centered:

Then press on Format:

And set Horizontal Alignment:

One more, rather trivial, point: if you don't enter line breaks, the entire result will be placed at the same line. (This will be useful for some Google chart cases, later). For example:
If I have 3 row of date with the 2 columns, they can be seen at the same line:


  1. can you share your code for the first performance looking tile please? I would like to use it for one of my project here.

    1. Sorry, that's 5 years old example.
      You can see the main part in the picture and the post, just close the