Monday, December 17, 2012

OBIEE Narrative and Google Charts - Basic

Please note that the printing and exporting of all of the bellow, only works in HTML and MHT formats.

We covered the following Narrative issues:
Basics of Narrative.
Creating Tiles with Narrative.
OBIEE and Narrative - Drill = Navigate to BI Content.
Now lets continue with Google Charts embedded in OBIEE using Narrative.

The issue of OBIEE and Google charts is not new. It was cover in several blogs, for example by John Minkjan here and here, by Paul McGarrick here and has few very nice examples in the large Sample Application available here. (Note John uses the depreciated charts engine and not the newer visualization that has a nice playground).

I decided to summarize the issue at this blog because it took me some effort doing few things that should have been easier, considering all the examples.

There are 2 major ways to do a Google Chart with Narrative. Most of the cases you will find in the internet create one line of data and pass it to Google Chart, that is the case of the second example by John Minkjan. Others will create an Array and use it for the chart. This is the first example.
 One additional option is to embed little charts in each row as was described by Paul McGarrick. We will not talk about the last option, since it does not involve Narratives.

Most of the Visualization option are best fit to arrays. How to create an array?

In the prefix of the narrative, for each column of the output we need data.addColumn(type, name); for example: data.addColumn('number', 'Revenue');
Then definition of the array: var myArray=[];
In the narrative itself we push each row of data into the array:
myArray.push([@1,@2,@3, @4, @5]);
And in the postfix we apply it: data.addRows(myArray);

You might need to increase the "default rows to display" beyond the default 30.
In the next post I will cover a sample of dual Y chart using Google visualization.
 

No comments:

Post a Comment