Sunday, 14 July 2013

OBIEE11g: How to Use Prompt as Report Selector or Using a Prompt as a Report Selector in OBIEE11g

Hello Everyone...

Recently many people started asking me to write a post on Using a Prompt as a report selector in OBIEE11g. We all know it is not a new requirement, It is most common requirement in many of the project. This is a bit tricky in 10g version but in 11g this is a simple task. In 10g version we are using "Guided Navigation Link" to get this done. In 11g version we can do it very simply using the "Section --> Condition" option in the dashboard. In this post we will see how to do it....

Scenario: We have three reports, for example 1) Yearly Revenue Report 2) Quarterly Revenue Report 
3) Monthly Revenue Report

The reports should be displayed on the dashboard as per the user selection i.e there should be a prompt which displays the three reports names depending on the report name that the user selected in the prompt the respective has to display. If the user selects Year value in the prompt then only year report has to display, If the user selects Quarter then Quarter report has to display and so on...

Here the user can have two choices either he can able to see only one report at a time using Radio button prompt or he can able to see multiple reports at a time using choices list prompt. In this post we will see the second option (Selecting multiple reports or Single report at a time). This is easy in 11g because of the Presentation Variable property, like i discussed in my earlier post the Presentation variable in 11g can capture multiple values. Please follow the below steps to do get this requirement....

Step 1: Creating the Reports

I am going to create three reports now Yearly Sales, Quarterly Sales and Monthly Sales as follows








Step 2: Creating the Dashboard Prompt

Create a new dashboard prompt by clicking on 'New" and then by selecting "Dashboard Prompt" as shown in the below screenshot


Now select the Subject Area from which you want to create the prompt. In my case i have used "Sample Sales Lite"


Click on the Add (+) icon and select Column Prompt



Now select any column from any of the tables because we not going to use any column values here we will create one dummy column and Hard code the report names as values.



I have selected the Per Name Year column and renamed it to "Select the Report" as shown in the below screenshots. Select the User Input as "Choice List" (By default it would be Choice List only)



Click on the Edit formula icon of the prompt and in the column formula.


Just enter any string value in the single quotes and click on Ok. In my case it is 'Dummy'


Now expand the Options ans select the "Choices List Values" as Specific Column Values as shown in the below screenshot.




Now Click on Edit icon and enter your report names as values of the prompt as per the requirement.


In my case i have given the report names as Year, Quarter and Month in the prompt. Here the report names are nothing but values of a column.


After entering the values click on Ok


Depending on your requirements select the options "Enable user to select multiple values", "Enable user to type values" and "Require user input".

Here very important thing is defining a "Presentation Variable" . In Select a Variable section select "Presentation Variable" then give one name in the below box. In my case i have created a variable called "Select" . All the presentation variable names are case sensitive so we need to be careful while creating a filter with presentation variable. You can see i have used the same name of the variable everywhere (Select) with the same case how ever i created it.

Enable user to select multiple values : If you need to enable multi values select option for the user you must select this option. In my case i would like to give the option to the end user to select multiple values so i enabled it by clicking on the check box.

Enable user to type values: Some times the user would like to type in the values like a text box field so this check box enables that feature so that the user can directly type the values with out selecting it from the prompt drop down.

Require user input: If you would like to make this prompt as a mandatory selection the you can select this check box. This option will disable the "Apply" button if the user is not selecting any value from the prompt.


After selecting all the required options save the prompt by clicking on Save icon as shown in the below screenshot.



Step 3: Creating the dummy reports for section condition validation.

Now create 3 dummy reports one for Yearly report , one for quarterly report and one for monthly report as shown in the below screenshots.

We have pull any column from any table to the criteria tab and go to Edit Formula and just give the Report name what ever you have given in the Prompt. The Report name that we have given in the Prompt and the value we are giving in this dummy column should be the same.

Remove the existing name give the new name as per the prompt value


 In my case i have given "Year" as a value in the prompt and the same i have given in the edit formula in the single quote as it is a string.


Now click on the filter of the column properties.


Select the operator as "Is equal to / Is in" then click on "Add More Options" and select "Presentation Variable" 


Type the presentation variable name that we have created. In my case it is "Select" (Case sensitive) and click on Ok.


After doing this you can see the filter as follows. Then save the report. In my case i have saved this report as Year Dummy.



Repeat the same process for creating Quarter Dummy report and Month dummy report as shown in the following screenshots.



By the end of this step you will have three dummy reports created Year , Quarter and Moth.

Step 4: Creating a New Dashboard to Place these reports.

Click on the New icon and select the "Dashboard" option.

Give the dashboard name. Here i have given the dashboard name as Report Selector. You can see the same on the following screenshots


Now add the content to the dashboard as shown below


Add four sections one is for Prompt , one is for Year report, one is for quarter report and one is for month report.


Now drag and drop the prompt and reports in the respected sections. Better to follow the order either ascending or descending because if you dont follow the order then the reports will display in jumbling manner when the user is selecting all the values in the prompts. I followed the descending order here so if we select all the values in the prompt then first Year, next Quarter and last Month Report will come in the order.



Now click on the section properties of the Year report section and select "Condtion"



Now click on Filter icon.



select Analysis and  click on Browse


select the Year Dummy report that we created in the previous step and click on Ok.



Click on Ok

Click on Ok



Repeat the same process for Quarter report section and Month Report Section



After adding the section conditions to the three report sections save the dashboard by clicking on the Save Icon and click on Run.



Now on the dashboard we can see only the prompt with three report names as check boxes as follows.



Now select the Year option and click on Apply ......



You can see only Year report on the dashboard



Now select the Quarter option and click on Apply ......


You can see only Quarter report on the dashboard


Now select the Month option and click on Apply ......


You can see only Month report on the dashboard



Now select all the three options and click on Apply ......



You can see all the three reports now ..... Year report, Quarter Report and Month Report on the dashboard in the same order how we kept the sections in the dashboards.



This is the continuation of the above screenshot.....




Hope this helps you.............

Thanks,
Nagarjuna

Monday, 29 April 2013

OBIEE11g: How to Call or Insert an Image in the Narrative View



Scenario : 

Recently we got a requirement to insert an image in to Narrative view of OBIEE Answers. We know how to call or insert an image in to Title view (by using fmap syntax).

Syntax: fmap:images/imagename.imageformat
e.g: fmap:images/ABC.jpg

In the same way we have one syntax to call an image in to Narrative view. 

Step 1: 

Place your images in the following paths 


Path 1:

OBIEE_HOME\Oracle_BI1\bifoundation\web\app\res\s_blafp\images

Path 2:

OBIEE_HOME\user_projects\domains\bifoundation_domain\servers\bi_server1\
tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\s_blafp\images


Note: After adding the images in the above mentioned paths presentation server restart is mandatory.

Step 2:

Create your analysis/report by adding the required columns to the criteria tab. Click on Results tab and create "Narrative View"

Paste the following code in the Narrative box

<img src="res/s_blafp/images/imagename.imageformat" />  <b><font Size=4>&nbsp;&nbsp Test Information</font size> </b> 



Here "Image_name" is the full name of the image which you placed in the above mentioned paths.

Passing the Values or Parameters from OBIEE report to any website

Scenario: 

Recently i have got a very interesting requirement i.e passing the parameters from OBIEE report to a different website. For example we have a report which displays delivery status of an Item, Let us say you purchased a mobile in online. Then you will receive the conformation of your shipment through the mail and mobile message. They are going to provide you one Unique ID for your shipment using which we can track the status of your shipment. for example assume that your shipment is done through Fedex, by using your unique tracking number you can find the shipment status by logging in to Fedex website. In this scenario the user wants to get the status of the shipment from OBIEE report itself. The report displays the tracking number column , Once the user clicks on the particular tracking number it has to go to the respective website and gets the details of that tracking number. In this post we can see how this can be achieved....

Step 1:

 Navigate the shipping website in our example it is Fedex. Try to get the details of any dummy tracking number. This exercise is only to capture the URL of that Page.

In the above example i have just logged in to Fedex website and given one dummy tracking number to capture the URL.

https://www.fedex.com/fedextrack/index.html?tracknumbers=12345678sdfsf&cntry_code=us

Here we need to analyze where the parameters are passing in this URL.

https://www.fedex.com/fedextrack/index.html?------> It is constant for all the tracking numbers, so it is not going to change.

tracknumbers-----> (12345678sdfsf) This is variable in nature here we need to pass the tracking number on which the user is clicking from OBIEE report.

&cntry_code=us----> This is the country code if we are looking at only US tracking numbers then we can make it as constant or we can change it using a variable.

Step 2:  

Edit the OBIEE report and go to Criteria tab. Click on the column properties of the tracking number column and go to Interaction tab. Go to Value--->Primary Interaction--->Select Action Links----> click on (+) "Add Action Link"


Step 3:

Then Click on "Create New Action"---> Select "Navigate to a Web Page"






Step 4:

You can see one new window popping up.In that new window paste the URL we got from the Fedex website. (https://www.fedex.com/fedextrack/index.html?tracknumbers=12345678sdfsf&cntry_code=us) then click on "Define Parameters" 


Step 5:

Then you can see the following window...




 Here we need to define the parameters. By default it recognizes the variables and defines below...In our example we have two parameters. 
1. Tracknumber
2.cntry_code 

Step 6:

Go to Value tab and click on the options and select Column Values and select the Tracking Number column.


Step 7:

 Check in all the check boxes as shown in the below screenshot..

Now we need to check with the URL highlighted in the above screenshot. There we can find some variable values in the following format {Variable_Name}. In our example we have two variables {1} and {2}

{1} = Tracking Number , It is going to capture the value of the tracking number on which the OBIEE user is clicking in the report.

{2} = Country Code, In this case it is fixed that is why we are selecting it as a static value from the value tab. In the same way we can define multiple parameters as per the requirement.

Step 8:

After doing all these configurations click on OK and go to Results tab. You can see the hyperlink is enabled on the Tracking Number column values. Click on any value it will navigate to the Fedex website and its going to show the status of the tracking number on which we clicked.

In the same way we can add multiple websites in the Action Link menu and define the conditional navigation.