Multi Select Prompt in OBIEE

35
Way To Solve Multiselect Prompt Bug Posted by sranka on April 6, 2009 Hi All, Thanks for all the positive response . Its been while since I posted any thing. Been busy with preparing for my collaboration-09 presenation. Yes!!! I am presenting at OAUG’s collaboration-09 conference schedule in the 1st week of May in Florida. For people who are interested, topic would be — Need for web 2.0 and OBIEE integration –. Coming back to this post. Faced some weird and unusual problem with Multiselect. The problem was so severe that if you don’t have proper security implemented on RPD side, than any one can see any data. hmmmmmm.. sounds scary!! yes it is scary so here is what happens. In the following image you get to see all the name of the countries from the selected continent. Results when clicked on ... from the base page The actual fun begins when you hit the Go button, and irrespective of which continent has been selected all the countries in the world will get displayed. see the image attached

Transcript of Multi Select Prompt in OBIEE

Page 1: Multi Select Prompt in OBIEE

Way To Solve Multiselect Prompt   Bug

Posted by sranka on April 6, 2009

Hi All,

Thanks for all the positive response . Its been while since I posted any thing. Been busy with preparing for my collaboration-09 presenation. Yes!!! I am presenting at OAUG’s collaboration-09 conference schedule in the 1st week of May in Florida. For people who are interested, topic would be — Need for web 2.0 and OBIEE integration –. Coming back to this post.

Faced some weird and unusual problem with Multiselect.  The problem was so severe that if you don’t have proper security implemented on RPD side, than any one can see any data. hmmmmmm.. sounds scary!! yes it is scary so here is what happens.  In the following image you get to see all the name of the countries from the selected continent.

Results when clicked on ... from the base page

The actual fun begins when you hit the Go button,  and irrespective of which continent has been selected all the countries in the world will get displayed. see the image attached

Results shown when clicked on the Go button on the result screen

What is the issue :

Page 2: Multi Select Prompt in OBIEE

After investigating found out that whenever GO button is clicked, the constraint value has not been passed and all the values from the dimensions, are been retrieved.

Solution:

To solve the issue we need to modify two javascript files residing in the folder res/b_mozilla/prompts/ :

globalfilterprompt.js changes to — GFPDoMultiSelect — function gfpmultiselect.js changes to — GFPMultiSelect.prototype.search — function

Changes :

Following is the modified — GFPMultiSelect.prototype.search — function, all the text in the bold are the changes ::

GFPMultiSelect.prototype.search = function(){this.sWhere = “”;

var obj1 = window.parent.document.getElementById(“customMSPromptdiv”);

/* sranka — added for MultiSelect Data Persistance*/try{if(obj1.value == ”){this.sWhere = ” ( 1 = 1 ) ” ;}else{this.sWhere =  obj1.value;}}catch(e){this.sWhere = ” ( 1 = 1 ) ” ;}

if(this.matchTable.style.display == ”){if (this.searchForm.Constraint.value != “”){var sValue = null;switch (this.searchForm.Match.value){case “beginsWith”:sValue = GFPMultiSelect.SQLEscape(this.searchForm.Constraint.value) + “%”;break;case “endsWith”:sValue = “%” + GFPMultiSelect.SQLEscape(this.searchForm.Constraint.value);break;

Page 3: Multi Select Prompt in OBIEE

case “contains”:sValue = “%” + GFPMultiSelect.SQLEscape(this.searchForm.Constraint.value) + “%”;break;case “like”:sValue = this.searchForm.Constraint.value;}

if (sValue != null)this.sWhere = this.sWhere + ” AND ” + this.vColumns[0] + ” LIKE ‘” + sValue + “‘”;

}}else if(this.dateTable.style.display == ”){var tA = null;var tB = null;

switch(GFPMultiSelect.primaryType){case ‘date’:tA = tDTP.parse(this.searchForm.BetweenA.value, 2 | 8 | 16 | 32);tB = tDTP.parse(this.searchForm.BetweenB.value, 2 | 8 | 16 | 32);break;case ‘time’:tA = tDTP.parse(this.searchForm.BetweenA.value, 4);tB = tDTP.parse(this.searchForm.BetweenB.value, 4);break;case ‘timeStamp’:// converttA = tDTP.parse(this.searchForm.BetweenA.value, 1 | 2 | 4 | 8 | 16 | 32);tB = tDTP.parse(this.searchForm.BetweenB.value, 1 | 2 | 4 | 16 | 32);//convert to data timezoneif (this.nDisplayToDataTZOffset){if (tA != null)tA.adjustTimeZoneOffset(this.nDisplayToDataTZOffset);if (tB != null)tB.adjustTimeZoneOffset(this.nDisplayToDataTZOffset);}break;}

if(this.searchForm.BetweenA.value.length > 0 && !tA){alert(kmsgWBInvalidInput + “\”" + this.searchForm.BetweenA.value + “\”");

Page 4: Multi Select Prompt in OBIEE

return false;}

if(this.searchForm.BetweenB.value.length > 0 && !tB){alert(kmsgWBInvalidInput + “\”" + this.searchForm.BetweenB.value + “\”");return false;}

if(tA != null){var sA = DateTimeParser.buildDateTimeClause(‘>’, this.vColumns[0], GFPMultiSelect.primaryType, tA);

if(sA != null)this.sWhere = sA;}

if(tB != null){var sA = DateTimeParser.buildDateTimeClause(‘<’, this.vColumns[0], GFPMultiSelect.primaryType, tB);

if(sA != null)this.sWhere = this.sWhere.length == 0 ? sA : (this.sWhere + ” AND ” + this.sWhere + ‘ AND ‘ + sA);

}

}else if(this.numericTable.style.display == ”){var tA = this.searchForm.BetweenNA.value;var tB = this.searchForm.BetweenNB.value;

if(tA.length > 0){tA = parseFloat(tA, 10);this.sWhere = this.sWhere + ” AND ” + this.vColumns[0] + “>=” + tA;}

if(tB.length > 0){tB = parseFloat(tB, 10);var clause = this.vColumns[0] + “<=” + tB;this.sWhere = this.sWhere + ” AND ” + this.sWhere.length == 0 ? clause : this.sWhere

Page 5: Multi Select Prompt in OBIEE

+ ” AND ” + clause;}}

this.choicesDiv.innerHTML = “”;this.totalSpan.innerHTML = “0″;this.totalSpan.setAttribute(“total”, 0);this.moreLink.style.display = “none”;

VTDisplayValues(this.choicesDiv, this.vColumns, this.subjectArea, ‘kmsgGFPMultiSelectSearchValueTableRow’, this.sWhere, this.timeZone, this.timeZoneOffset,‘scroll’, this.sId, null, null, null, null, null, “idGFPMultiSelect” + this.sId);}

Following is the modified — GFPDoMultiSelect– function, all the text in the bold are the changes ::

function GFPDoMultiSelect(tEvent, sTextAreaID, sColumn, sSubjectArea, sWhere, sID, sCategory, sPrimaryType, sDisplay, sSQL, sDataTimeZoneOffset, sDisplayTimeZone){

/* sranka — Added this code as patch for persisting values for MultiSelect */var parentElem = window.parent.document.getElementById(sTextAreaID);//alert(‘GFPDoMultiSelect GlobalFilterPrompt.js :: ‘ +sTextAreaID);var newdiv = window.parent.document.createElement(‘input’);var divIdName = ‘customMSPromptdiv’;newdiv.setAttribute(‘id’,divIdName);newdiv.setAttribute(‘name’,'name’);newdiv.setAttribute(‘value’,sWhere);newdiv.setAttribute(‘type’,'text’);

var browserName=navigator.appName;

if(browserName == ‘Netscape’){parentElem.appendChild(newdiv);}else{window.parent.parent.document.body.appendChild(newdiv);}

var tMultiSelect = new GFPMultiSelect();var tDialog = new XUIDialog(“idGFPMultiSelect”+sID, tMultiSelect, null);tDialog.show(null, -1, -1, null, null, null, null, true);tMultiSelect.initialize(sTextAreaID, sColumn, sSubjectArea, sWhere, sID, sCategory, sPrimaryType, sDisplay, sSQL, sDataTimeZoneOffset, sDisplayTimeZone);

Page 6: Multi Select Prompt in OBIEE

return false;}

I hope this will help solving some of the issue. I know that the code I have provided is not well formatted, please ping me or leave me a message for any questions or difficulties.

OBIEE Number of values in the multiselect prompt

If you want more or less choices returned alter / add this in the instanceconfig.xml:

{Prompts}

{MaxScrollValues}100{/MaxScrollValues}

{/Prompts}

Today I want to discuss the multi-select prompt below. You should recognize this one easily – since most of you work with this quite frequently. Ta-da:

Page 7: Multi Select Prompt in OBIEE

OBIEE multi-select

What’s wrong with it, can you ask me?

Well, the major one – I and many of the clients complained about when I worked for them – believe that it’s counter-intuitive to drag from right to the left. At least in Western culture (USA, Europe, Latin America), it’s been accepted that information is read from left to right. I won’t get into much details, but in most software that I use on a daily basis, such functionality works the other way than implemented in OBIEE – you drag from left to right. This is the biggest issue, which I hope Oracle’s developers would fix in 11g (if they don’t, I know it’s not their fault).

Second problem, you need to click Go button in order to get results. In this age of web 2.0, AJAX, etc. – it would be relatively easy to start outputting results once you start typing. I agree, this isn’t a bug per se, rather an interface issues. However, users now need to spend more time in the multi-select  – instead of going straight to the data.

Third issue, 1-column positioning of data in the select window. There’s so much white space, that it could be spent better. I don’t think quality software should leave doubts in its user interface. There’s no doubt that it’s not a show stopper, but again, those little things might attribute to better acceptance by potential clients.

Finally, OK and cancel buttons should be positioned in the center. I’m not claiming to be a design and usability expert, but I observed people spending time trying to figure out what to do next, or worse, clicking on Cancel – subconsciously.

OBIEE’s Multi-select has been a source of frustration, anger, and complains from my users.

I always addressed this as a training issue, and I still hope for a fix.

Page 8: Multi Select Prompt in OBIEE

P.S. while writing this I thought – “Is it possible to re-work the box?”…technically, that shouldn’t be difficult – script responsible for it is here: res/b_mozilla/prompts/gfpmultiselect.js  By some java-script re-arranging – it should be possible to “reverse” boxes. Problem with that is it would constitute a major code change and loss of Oracle support, and possibly infringing on the license.

Just by looking at script – it seems as nothing have changed since 2002. Also, it would be nice to have a feature of designing own UI (such as using skins, templates, radio-buttons, other interface elements).

Oracle BI EE 10.1.3.4.1 – Multi-Select Prompts, String AggregationFri, 11/06/2009 - 06:56

http://www.rittmanmead.com/2009/11/oracle-bi-ee-10-1-3-4-1-multi-select-prompts-string-aggregation/

One of the issues that people often face while using BI EE is the lack of control on Multi-

Select prompts. One cannot set Multi-Select prompts to a presentation variable & similarly one

cannot display the multi-selected values in a report (only filter view supports the display of all the

selected values). The most common requirement is to do string operations on the multi-selected

values by treating them all as a single string.

The other requirement that i have seen in the past is to do String Aggregation on certain

dimensional attributes. Currently BI EE does not have any specific aggregations for strings. One

can theoretically use FIRST, LAST etc kind of aggregation on string columns but those are not

aggregations per se. A typical string aggregation would involve concatenation of all the strings in

a specific format.

Both the above requirements can be solved by a simple technique. From a requirements

perspective, they are different. But from an implementation standpoint both are similar as both the

requirements require BI EE to do a string concatenation. To accomplish this we shall be using the

COLLECT database function that was introduced in 10g. If you are in pre-10g release, you can

use the STRAGG function created by Tom Kyte. And if you somehow have upgraded to 11gR2,

then you can use LISTAGG. The idea is, we push down the aggregation part of the strings to the

database and then use them directly in BI EE. The example that i shall be going through today

will involve a simple Mult-Select Prompt on the CHANNELS_DESC column of the CHANNELS

table in the commonly used SH schema. The requirement is to display the chosen multi-select

values as a column in the report as shown below

Page 9: Multi Select Prompt in OBIEE

There are basically 2 ways of achieving this. I will demonstrate both of them here. Both the

approaches require the aggregation to be pushed into the database. So, we start with creating a

Type and a database function to convert the output of the COLLECT function to a set of strings.

create or replace type MultiSelect as table of varchar2(1000);

CREATE OR REPLACE FUNCTION MultiSelect_Pipe (p_MSP IN MultiSelect)

RETURN VARCHAR2 IS

var_msp VARCHAR2(4000);

var_index NUMBER;

BEGIN

var_index := p_msp.FIRST;

IF var_index IS NOT NULL THEN

var_msp := '(''';

WHILE var_index IS NOT NULL LOOP

IF var_index <> 0 THEN

var_msp := var_msp || p_msp(var_index) || ''',''';

END IF;

var_index := p_msp.NEXT(var_index);

END LOOP;

var_msp := substr(var_msp,1,length(var_msp) - 2) || ')';

END IF;

RETURN var_msp;

END MultiSelect_Pipe;

If we test the above function in SQL, we should get the output in a string concatenated form.

select distinct

multiselect_pipe(cast((collect(channel_desc) Over ()) as Multiselect))

AS Channel_desc_agg from channels

Page 10: Multi Select Prompt in OBIEE

Approach 1:

This approach will directly use the above function that we created above using EVALUATE from

the repository. There are some drawbacks with this approach which shall be covering later. To

implement this, we need to create a new column and basically use the same function within

Evaluate function in the repository as shown below

EVALUATE('MULTISELECT_PIPE(CAST((COLLECT(%1) OVER ()) AS MULTISELECT))' AS

CHARACTER ( 1000 ),

"ORCL".""."SH"."CHANNELS"."CHANNEL_DESC")

If this column is exposed in the presentation layer, one can now use this column in the report

directly. It will capture the multi-select values from the prompt as well.

Page 11: Multi Select Prompt in OBIEE

And if you look at the query, you will notice that the database function gets pushed in to the sql.

The filter values applied on the multi-select prompt will be honored by the database function as

well.

Select

MULTISELECT_PIPE(CAST((COLLECT(T26412.CHANNEL_DESC) OVER ()) AS

MULTISELECT)) as c1,

T26412.CHANNEL_DESC as c2,

T24112.PROD_CATEGORY as c3,

sum(T24170.AMOUNT_SOLD) as c4

from

PRODUCTS T24112,

CHANNELS T26412,

SALES T24170

where ( T24112.PROD_ID = T24170.PROD_ID

and T24170.CHANNEL_ID = T26412.CHANNEL_ID

and (T26412.CHANNEL_DESC in ('Direct Sales', 'Tele Sales')) )

group by T24112.PROD_CATEGORY, T26412.CHANNEL_DESC

order by c1, c2, c3

There are a couple of drawbacks with this approach. Since we are not isolating the filter on the

String aggregated column, if your fact table does not have a value for a chosen prompt value, that

will not be included in the output. For example, lets assume that in the multi-select prompt we are

choosing 3 channel values i.e Catalog, Direct Sales and Tele Sales. There is no transaction for

Catalog in the Fact table. So, the string aggregated column will show only Direct Sales and Tele

Sales. This is not a true reflection of the Multi-Select prompt values.

Page 12: Multi Select Prompt in OBIEE

Also, the CHANNEL_DESC_AGG column requires CHANNEL_DESC column to be part of the

query as well. If not, BI EE will try to push the analytic function into the group by clause there by

resulting in an error.

Approach 2:

Both the issues above can be negated by using another approach. This approach will use the

same database function. But what we will be doing here is, we will be modeling our repository in

such a way that BI EE will split the above the report’s single query into 2 separate queries. So we

start with creating a new database connection (this is needed) and copying the CHANNELS table

over to the new connection.

Page 13: Multi Select Prompt in OBIEE

Then we create a physical layer join between the CHANNELS table in the original SH schema

database and the CHANNELS table in the new database

In the BMM layer, we need to snowflake the Channels dimension by adding a new logical table

called Channels_Agg. This new logical table will contain the EVALUATE column(same as in

Approach 1) and the CHANNEL_DESC column.

Page 14: Multi Select Prompt in OBIEE

Create a logical snowflaked join between Channels and Channels Agg logical tables. In the

presentation layer, expose CHANNEL_DESC and CHANNEL_DESC_AGG columns from the

Channel Agg logical table. Lets now test the above Multi-Select report again with the same 3

values (one missing in fact table)

As you see, the above is a true reflection of the Multi-Select prompt. It always shows the values

chosen in the prompt no matter what values are present in the fact table. If you look at the SQL,

you would notice 2 separate queries being fired by BI EE.

Page 15: Multi Select Prompt in OBIEE

Also, this does not depend on the selection of CHANNEL_DESC column in the report.

Currently we had to use the analytic function since BI EE cannot do analytic equivalent functions

directly from the repository (though one can mimic them using level based measures but we do

not have complete control on the queries). Hopefully as new releases come out, we should see

such capabilities in the repository itself.

Saturday, July 26, 2008

OBIEE Number of default values in a multiselect prompt Q: There seems to be a maximum to the number of default values on a multiselect control prompt, can we set this to 5000?

A: Yes, the default is 255, but why the hell you want to do that? Big chance that you run into trouble with the "in" statement OBIEE will create from this prompt!

Page 16: Multi Select Prompt in OBIEE

Anyway, this is how you do it:Add / modify the following in your instanceconfig.xml:{Prompts}{MaxDefaultValues}5000{/MaxDefaultValues}{/Prompts}

Till Next Time

OBIEE dropdown prompt Q: Is it possible to add 10.000 entries to a dropdown promptA: Yes, but why the hell you want to do that since OBIEE doesn't know autofill?

Anyway, this is how you do it:Add / modify the following in your instanceconfig.xml:

{Prompts}{MaxDropDownValues}10000{/MaxDropDownValues}{/Prompts}

OBIEE Protect Filter I had to make demo on protecting filters for a small class I gave. Let's start with a simple report against the SH repository:

Put in a basic OR filter

Have a look a the result:

Make a basic prompt:

Put it all on a dashboard:

Page 17: Multi Select Prompt in OBIEE

Select the year 2000:

You will see that you loose the "OR" function.Now go back to your report on the first filter part check the Protect Filter option:

Save your report and go back to the dashboard. Select the year 1999 and press go.

You will see that the "OR" part stays intact.Now go back to your report on the second filter part check the Protect Filter option:

Save the report and go back to your dashboard. Whatever year you select the result will not change.

Till Next Time

Page 18: Multi Select Prompt in OBIEE

Select Views through Dashboard Prompts in OBIEE Hi All,  Following is a workaround to mimic view selector in prompts...

1. Determine the number of views be shown in a view selector originally. Say n views.

2. Build a dashboard drop down prompt with n view names as drop down values. Say varSelector as corresponding presentation variable. Total number of values in the drop down is equal to n.

3.  Now create n dummy queries (usually with just a single column which executes very quickly) with a filter like the one shown below:

 replicate the report by changing the filter values (equal to view names) as follows:

         likewise build n dummy reports, with view names as filters.                 

4. Dismantle the view selector (break the view selector into multiple reports), if a report is already built using View Selector, or create a separate report for each view in the drop down prompt.

5. Now in the dashboard, drag each report created in step 4 into different sections.  In the Following screen shot there are 3 different sections, as there are 3 views (By Type, By Location, By Type and Location).

Page 19: Multi Select Prompt in OBIEE

6. On each ReportSection1, ReportSection2,…click properties to apply guided navigation on section as follows:

Note: the corresponding dummy reports created in step 3 should be referenced in the “Source Request” Option…i.e. based on the drop down selection in the front-end, variable is passed to dummy reports and only corresponding dummy report will retrieve data, other reports retrieve 0 rows. Thus hiding all other sections and displaying only the report selected. All the Guided Navigation Section Properties are set to same options shown above, except the source request. 

I hope it's tedious, but easy to comprehend. I will try to submit a more simplified version later.       Comments are welcome.

OBIEE - Reporting on Multiple Subject Area (Advanced Logical SQL)

About

The GUI of OBIEE 10g answer is already able to report against multiple subject area with the “Combine with similar request”.

Page 20: Multi Select Prompt in OBIEE

This functionality support only the following Set Operations:

UNION UNION ALL Intersect Minus

but not all other standard set sql clause such as joins.

Even if the GUI of answer can do it, BI Server is able to read and to serve this kind of clause because the logical sql is ANSI SQL 92 compliant.

This article show you with a little bit of advanced logical sql how to report against Multiple Subject area with the most use join clause statement in this case: the FULL OUTER JOIN.

While writing an advanced logical sql, it's good to keep in mind that:

Page 21: Multi Select Prompt in OBIEE

the subject area is a sort of BIG flat, completely denormalized table of a star schema

and that the presentation table are only map to sort/classify the column.

You can't perform a join condition between table of a subject area but between two subject areas.

To develop your Logical SQL, you can use an ODBC client such as the Issue SQL module of BI Presentation Service.

This step by step guide is made with the help of the SH sample schema.

Articles Related

OBIEE - Answer OBIEE - Full outer Join OBIEE - Logical Sql OBIEE - Subject Area / Presentation catalog

Design of the repository

For the purpose of the demonstration, a second fact table will be:

created in the database and added to the repository

Creation of the second Fact tableSQL> CREATE TABLE FactWithCustomerDim AS SELECT amount_sold - 1 "amount", cust_id FROM sales; TABLE created.

Repository Design

Simple picture to see the different repository steps:

Page 23: Multi Select Prompt in OBIEE

You can then see in the advanced tab of answer the following logical Sql:

SELECT Customers."Cust Id" saw_0, Customers."Cust Last Name" saw_1, "Sales Facts"."Amount Sold" saw_2 FROM SH WHERE Customers."Cust Id" < 10 ORDER BY saw_0, saw_1

Against the second Subject Area

Just create a second simple report such as below:

You can then see in the advanced tab of answer the following logical Sql:

SELECT Customers."Cust Id" saw_0, Customers."Cust Last Name" saw_1, "FactWithCustomerDim"."Amount" saw_2 FROM SH2 WHERE Customers."Cust Id" < 9 ORDER BY saw_0, saw_1, saw_2

Against two Subject Areas (Multiple Subject Area)

In the 10g version, the GUI of Answer is not able to provide a wizard to create a SQL (answer) against multiple subject with the JOIN clause, you have to create it manually and past it in the advanced tab.

To develop your Logical SQL, you can use an ODBC client such as the Issue SQL module of BI Presentation Service.

Page 24: Multi Select Prompt in OBIEE

Steps:

Go to the advanced tab of answer and copy/paste the following Logical Sql which is a OBIEE - Full outer Join of the two previous sql:

SELECT SubjectArea1.saw_0 saw_0, SubjectArea1.saw_1 saw_1, SubjectArea1.saw_2 saw_2, SubjectArea2.saw_2 saw_3 FROM ( SELECT Customers."Cust Id" saw_0, Customers."Cust Last Name" saw_1, "Sales Facts"."Amount Sold" saw_2 FROM SH WHERE Customers."Cust Id" < 10 ) SubjectArea1 FULL OUTER JOIN ( SELECT Customers."Cust Id" saw_0, Customers."Cust Last Name" saw_1, "FactWithCustomerDim"."Amount" saw_2 FROM SH2 WHERE Customers."Cust Id" < 9 ) SubjectArea2 ON SubjectArea1."Cust Id" = SubjectArea2.saw_0 ORDER BY saw_0, saw_1

Click op the set XML button and review the result report

Page 25: Multi Select Prompt in OBIEE

BI Server Log

In the log, you can see that because the two subject area are made on the top of the same data source, the query compiler create and send only one Physical Sql (part “Sending query to database named orcl SH”).

+++Administrator:330000:330009:----02/09/2010 12:18:46

##############################################-------------------- SQL Request:SET VARIABLE QUERY_SRC_CD='Report',SAW_SRC_PATH='/users/administrator/MultipleSubjectArea/Report on Multiple Subject Area';SELECT SubjectArea1."Cust Id" saw_0, SubjectArea1.saw_1 saw_1, SubjectArea1.saw_2 saw_2, SubjectArea2.saw_2 saw_3 FROM ( SELECT Customers."Cust Id" "Cust Id", Customers."Cust Last Name" saw_1, "Sales Facts"."Amount Sold" saw_2 FROM SH WHERE Customers."Cust Id" < 10 ) SubjectArea1 FULL OUTER JOIN ( SELECT Customers."Cust Id" saw_0, Customers."Cust Last Name" saw_1, "FactWithCustomerDim"."Amount" saw_2 FROM SH2 WHERE Customers."Cust Id" < 9 ) SubjectArea2 ON SubjectArea1."Cust Id" = SubjectArea2.saw_0 ORDER BY saw_0, saw_1

+++Administrator:330000:330009:----02/09/2010 12:18:46

-------------------- General Query Info:Repository: Star, Subject Area: SH, Presentation: SH

+++Administrator:330000:330009:----02/09/2010 12:18:46

-------------------- Logical Request (before navigation):

RqList Customers.Cust Id as c1 GB, Customers.Cust Last Name as c2 GB, Amount Sold:[DAggr(Salesfacts.Amount Sold by [ Customers.Cust Id, Customers.Cust Last Name] )] as c3 GBDetailFilter: Customers.Cust Id < 10

+++Administrator:330000:330009:----02/09/2010 12:18:46

-------------------- General Query Info:Repository: Star, Subject Area: SH, Presentation: SH2

+++Administrator:330000:330009:----02/09/2010 12:18:46

-------------------- Logical Request (before navigation):

RqList

Page 26: Multi Select Prompt in OBIEE

Customers.Cust Id as c1 GB, Customers.Cust Last Name as c2 GB, AMOUNT:[DAggr(FactWithCustomerDim.AMOUNT by [ Customers.Cust Id, Customers.Cust Last Name] )] as c3 GBDetailFilter: Customers.Cust Id < 9

+++Administrator:330000:330009:----02/09/2010 12:18:46

-------------------- Execution plan:

RqList <<48903>> [for database 3023:156:orcl SH,46] D1.c1 as c1 [for database 3023:156,46], D1.c2 as c2 [for database 3023:156,46], D1.c3 as c3 [for database 3023:156,46], D2.c3 as c4 [for database 3023:156,46]Child Nodes (RqJoinSpec): <<48917>> [for database 3023:156:orcl SH,46] ( RqList <<49139>> [for database 3023:156:orcl SH,46] CUSTOMERS.CUST_ID as c1 [for database 3023:156,46], CUSTOMERS.CUST_LAST_NAME as c2 [for database 3023:156,46], sum(SALES.AMOUNT_SOLD by [ CUSTOMERS.CUST_ID] ) as c3 [for database 3023:156,46] Child Nodes (RqJoinSpec): <<49028>> [for database 3023:156:orcl SH,46] CUSTOMERS T186 SALES T245 DetailFilter: CUSTOMERS.CUST_ID = SALES.CUST_ID and CUSTOMERS.CUST_ID < 10 and SALES.CUST_ID < 10 [for database 0:0] GroupBy: [ CUSTOMERS.CUST_ID, CUSTOMERS.CUST_LAST_NAME] [for database 3023:156,46] ) as D1 FullOuterJoin <<48901>> On D1.c1 = D2.c1 ( RqList <<49155>> [for database 3023:156:orcl SH,46] CUSTOMERS.CUST_ID as c1 [for database 3023:156,46], CUSTOMERS.CUST_LAST_NAME as c2 [for database 3023:156,46], sum(FactWithCustomerDim.AMOUNT by [ CUSTOMERS.CUST_ID] ) as c3 [for database 3023:156,46] Child Nodes (RqJoinSpec): <<49098>> [for database 3023:156:orcl SH,46] CUSTOMERS T186 FactWithCustomerDim T7425 DetailFilter: CUSTOMERS.CUST_ID = FactWithCustomerDim.CUST_ID and CUSTOMERS.CUST_ID < 9 and FactWithCustomerDim.CUST_ID < 9 [for database 0:0] GroupBy: [ CUSTOMERS.CUST_ID, CUSTOMERS.CUST_LAST_NAME] [for database 3023:156,46] ) as D2OrderBy: c1 asc, c2 asc [for database 3023:156,46]

+++Administrator:330000:330009:----02/09/2010 12:18:46

-------------------- Sending query to database named orcl SH (id: <<48903>>):WITH

Page 27: Multi Select Prompt in OBIEE

SAWITH0 AS (select T186.CUST_ID as c1, T186.CUST_LAST_NAME as c2, sum(T245.AMOUNT_SOLD) as c3from SH.CUSTOMERS T186, SH.SALES T245where ( T186.CUST_ID = T245.CUST_ID and T186.CUST_ID < 10 and T245.CUST_ID < 10 ) group by T186.CUST_ID, T186.CUST_LAST_NAME),SAWITH1 AS (select T186.CUST_ID as c1, T186.CUST_LAST_NAME as c2, sum(T7425.AMOUNT) as c3from SH.CUSTOMERS T186, SH.FactWithCustomerDim T7425where ( T186.CUST_ID = T7425.CUST_ID and T186.CUST_ID < 9 and T7425.CUST_ID < 9 ) group by T186.CUST_ID, T186.CUST_LAST_NAME)select SAWITH0.c1 as c1, SAWITH0.c2 as c2, SAWITH0.c3 as c3, SAWITH1.c3 as c4from SAWITH0 full outer join SAWITH1 On SAWITH0.c1 = SAWITH1.c1order by c1, c2

OBIEE Tips #5: Too many values in single select prompt

20 Dec

OBIEE’s single select prompt can’t display by default more than 256 values (It displays a “Too Many Values” value at the end of the list when the number of values is greater than 256).

This can be fixed in two ways:

1) edit the instanceconfig.xml file by adding the following line:

view source

print ? 1 <Prompts><MaxDropDownValues>MAX_VALUES</MaxDropDownValues></Prompts>

where MAX_VALUES is the number of values the prompt will display.Take care: a big value could affect the performances.

Page 28: Multi Select Prompt in OBIEE

2) Change the single-select value prompt to the multi-select value prompt. Multi-select value prompt displays all the values without limitation.

By default it displays the first 50 values and a link to show the next 50 and so on.This value can be modified; just edit the instanceconfig.xml file by adding the following line:

view source

print ? 1 <Prompts><MaxScrollValues>SCROLL_VALUES</MaxScrollValues></Prompts>

where SCROLL_VALUES is the values’ range number to show.

3) If you need to use a single select prompt because of business requirements, the best way is to create a first prompt by which you can select a first subset of values and constrained the next one on that.

The example above has been done quickly by changing the “Starts With” prompt formula that generates the range values with the following code:

view source

Page 29: Multi Select Prompt in OBIEE

print ? 01 CASE

02WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'A' THEN 'A-F'

03WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'B' THEN 'A-F'

04WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'C' THEN 'A-F'

05WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'D' THEN 'A-F'

06WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'E' THEN 'A-F'

07WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'F' THEN 'A-F'

08   

09WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'G' THEN 'G-L'

10WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'H' THEN 'G-L'

11WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'I' THEN 'G-L'

12WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'J' THEN 'G-L'

13WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'K' THEN 'G-L'

14WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'L' THEN 'G-L'

15   

16WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'M' THEN 'M-R'

17WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'N' THEN 'M-R'

18WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'O' THEN 'M-R'

19WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'P' THEN 'M-R'

20WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'Q' THEN 'M-R'

21WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'R' THEN 'M-R'

22   

23WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'S' THEN 'S-Z'

24WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'T' THEN 'S-Z'

25WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'U' THEN 'S-Z'

Page 30: Multi Select Prompt in OBIEE

26WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'W' THEN 'S-Z'

27WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'X' THEN 'S-Z'

28WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'Y' THEN 'S-Z'

29WHEN SUBSTRING("D5 Employee"."E01  Employee Name" FROM 1 FOR 1) = 'Z' THEN 'S-Z'

30   31 ELSE 'UNKNOWN'32   33 END

That should not be done in a production environment; infact it’s better to map the range values in a table and add the appropriate business logic.