Query Failed: [nQSError: 42043] An external aggregate is found in an outer query

I thought this might be useful for someone struggling with Essbase.

Client was on OBI 10.1.3.4.0 QF 170 and Oracle’s Hyperion Essbase 9.3.1 and running a report in Answers based on ASOSample Essbase cube which is generating an error.

In Answers Customer has created a report with a measure column (selected twice) which is being filtered with 2 different values using the filter function as below:

Add the 1st column
a. In Answers, Navigate to the Criteria Tab,
b. Select the column “Original Price”
c. On the column, click ‘edit formulae’,
d. in the edit formulae box, click the ‘Filter’ button
e. Insert a filter for the column, by selecting from the selection pane
column “Products”.”Product SKU” = ‘Boomboxes’.
.
Add the second column
Repeat the above steps a-d
In step e, Insert a filter for the column, by selecting from the selection pane column “Products”.”Product SKU” = ‘DVD’

The report can also be generated by directly entering the following SQL in Advanced Tab
select
Filter( Sample.”Original Price” using “Products”.”Product SKU” = ‘Boomboxes’ ),Filter( Sample.”Original Price” using “Products”.”Product SKU” = ‘DVD’ )
from ASOSamp

————–
When the report is run the error message that is generated is as below

Query Failed: [nQSError: 42043] An external aggregate is found in an outer query

The MDX generated is

With
set [Products5] as ‘{[Products].[Boomboxes], [Products].[DVD]}’
set [Axis1Set] as ‘crossjoin ({[Age3]},crossjoin ({[Attribute Calculations2]},crossjoin ({[Geography5]},crossjoin ({[Income Level2]},crossjoin ({[Payment Type2]},crossjoin ({[Products6]},crossjoin ({[Promotions2]},crossjoin ({[Stores4]},crossjoin ({[Time5]},crossjoin ({[Transaction Type2]},{[Years2]}))))))))))’
select
{[Measures].[Original Price]} on columns,
NON EMPTY {[Axis1Set]} properties ANCESTOR_NAMES, GEN_NUMBER on rows
from [ASOsamp.Sample]
Cause

By default in the OBI rpd, the Aggregation rule is set to “External Aggregation”. As per Engineering this needs to be change, so OBI EE knows what those rules are.

Filter By clauses are not supported by MDX (or Essbase), so OBI EE has to perform those internally. If the Aggregation rule is set to “External Aggregation”, then OBI EE doesn’t know what those rules are and hence throws this error.
Solution

It is possible to fix the error by doing the below

1. Changing the OBI Aggregation rule in both the Physical and BMM layer to the corresponding rule in Essbase, would stop the error.

2. Alternatively, using OBI Answers filter clauses would allow the BI Server to re-write the MDX to push down the filter to Essbase and may be more efficient anyway.

There was an enhancement raised within Oracle to address this matter in a future release, as the client stated that changing the aggregation rule in the rpd is not a suitable option.

Creating a table view with two levels of headers

This tutorial applies to:Business Intelligence Server Enterprise Edition – Version: 10.1.3.4.0 [1900] – Release: 10g

The question was rather frequent – “How to create a table view with two levels of headers?”

i.e. the high-level heading as the table title heading and then another level of heading where there is one sub-heading/title for one set of columns and a different sub-heading for another set of columns

The high-level heading can be created by adding a title view for this.

And then for 2nd level of sub-heading that should be different for one set of columns and another sub-heading for another set of columns, you can achieve this by displaying the table headings as well in addition to the column headings and then set the custom table heading appropriately for the respective set of columns that require the same heading.

To do this, you need to follow a 2-step approach
1) go to the table view and edit the table view properties. Set the ‘display column & table headings’ property to ‘as separate rows’ instead of ‘only column headings’.
2) Then go to each column and set the custom table heading. Set the same table heading for all the columns that require the same heading.

OBI SERVER GENERATES INCORRECT SQL WHEN ‘BETWEEN’ AND ‘OR’ CLAUSES EXCEED EIGHT IN WHERE CLAUSE

When running a report using eight BETWEEN clauses or less for a report that should bring back zero rows, for example

SELECT Products.Brand saw_0 FROM Paint
WHERE (Products.Brand BETWEEN ‘0’ AND ‘1’)
OR (Products.Brand BETWEEN ‘1’ AND ‘2’)
OR (Products.Brand BETWEEN ‘2’ AND ‘3’)
OR (Products.Brand BETWEEN ‘3’ AND ‘4’)
OR (Products.Brand BETWEEN ‘4’ AND ‘5’)
OR (Products.Brand BETWEEN ‘5’ AND ‘6’)
OR (Products.Brand BETWEEN ‘6’ AND ‘7’)
OR (Products.Brand BETWEEN ‘7’ AND ‘8’)
ORDER BY saw_0

the following warning is displayed:

“…

No Results
The specified criteria didn’t result in any data. This is often caused by applying filters that are too restrictive or that contain incorrect values. Please check your Request Filters and try again. The filters currently being applied are shown below ..”

This is the correct result.

However, when an additional BETWEEN clause is added (i.e nine BETWEEN clauses in total) for example

SELECT Products.Brand saw_0 FROM Paint
WHERE (Products.Brand BETWEEN ‘0’ AND ‘1’)
OR (Products.Brand BETWEEN ‘1’ AND ‘2’)
OR (Products.Brand BETWEEN ‘2’ AND ‘3’)
OR (Products.Brand BETWEEN ‘3’ AND ‘4’)
OR (Products.Brand BETWEEN ‘4’ AND ‘5’)
OR (Products.Brand BETWEEN ‘5’ AND ‘6’)
OR (Products.Brand BETWEEN ‘6’ AND ‘7’)
OR (Products.Brand BETWEEN ‘7’ AND ‘8’)
OR (Products.Brand BETWEEN ‘8’ AND ‘9’)
ORDER BY saw_0

the result should also return zero rows but this report returns all rows in the table.

In the query using nine BETWEEN clauses, the WHERE clause of the SQL generated does not include the BETWEEN filter conditions hence all rows in the table are returned.

It was determined to be a bug – OBI SERVER GENERATES INCORRECT SQL WHEN BETWEEN AND OR CLAUSES EXCEED EIGHT, has been raised to address this sissue.

The issue is that for the case when there are more than 8 filters, e.g 9 filters in a query, OBI Server seems to drop the filter with the result that it erroneously returns incorrect number of rows.

OBIEE Certification

Still there’s nothing from Oracle in regards to official OBIEE certification. Latest official info is here: http://blogs.oracle.com/certification/2008/09/obiee_certification.html

My personal opinion is that although a certification program would be nice, but not by any means necessary. I see several major problems with Oracle’s OBIEE certification:

a) possible requirement for compulsory training at Oracle University before taking certification – while taking training is not a bad idea in itself, financial issues arise. Who’s going to cover costs of this training? I’m sure that many people wouldn’t get reimbursed by  their employers at this economy.  Should they be paying by themselves? I’m sure that shelling out thousands of dollars out-of-pocket isn’t an attractive option for many people.  My last argument is that some people don’t really need (or feel that they need) to take training in order to pass the qualification exam.

b) Passing the majority of certifications is rarely requiring more than just answering multiple-choice questions. So in reality, it’s just about how well someone answers the questions, not the level of knowledge / proficiency with the technology. Of course, someone who’s adept at OBIEE would have no problems whatsoever answering the questions, but so is someone who just crammed the documentation well. There’s no way objectively distinguishing between them if they both passed the exam. I’m not even talking about brain dumps where one can get all the questions.

To be successful, the certification should involve some lab work. It should be accessible to anyone who could prove OBIEE proficiency (maybe with some preliminary test). And it shouldn’t be burdensome, Oracle shouldn’t use the certification as a revenue maker, but instead focus on building relationships and trust between consultants / developers and clients.

Oracle Technical Support & Proper way to file SR

It always amazes me how some people don’t bother doing simple research before asking question on OTN. I’m sure that sometimes they just don’t have time to explore the issue by themselves or maybe they don’t know where they should look for information. Questions in one sentence like “My BI Server isn’t starting” or “I have ODBC error” without detailed description pop-up all the time on OTN. I’m a huge fan of metalink (i’m using metalink 3) – I’ve been able to locate some answers always instantly especially before OTN has become such a useful place as it’s now. Filing a service request is a sure way to at least get to the cause of the problem. Of course many times you would hit a BUG or a ENHANCEMENT REQUEST but at least you would know that it’s not your fault.  Through trial and error I’ve compiled a list of best practices that will help you to maximize your Oracle Support experience. Enjoy my SR tutorial:

Most important pre-SR exercise – run a simple search in Metalink / OTN to make sure that this issue haven’t been identified yet – there’s nothing worse than going through days of support e-mail back and forth and then receiving an e-mail that it’s a well-known bug / feature.

1. Make sure to give as detailed description of the problem as possible. Try to describe circumstances when it happens. If you have a question about functionality, be specific about your needs and what you are trying to achieve. If your description is very long – I suggest you type it in word and attach along with the rest of your SR.

2. Take screen shots of the error screens. Circle the problematic area or error message to help support analyst to pinpoint the problem.

3. Put your RPD, web catalog, screen shots into 1 archive. Attach lines from relevant log files (not the whole thing, but extracts). And attach it to the SR. Don’t forget to give your RPD’s admin password.I realized that most of the time, support would request those anyway, so you can be proactive about it. Why shouldn’t you do it now, rather than wait for them to ask you to submit those.

4. Be patient. You SR is important, but sometimes analysts get busy with high-priority tickets. Don’t escalate if nobody is replying within 1 day.  My experience shows that people want to help – it’s just maybe they’re taking their time to counsel with someone else and that’s the reason of the hold-up.

5. Be courteous. If there’s an update or request for more information – do your diligence and reply right away. If you receive an Oracle survey afterward, take a few minutes and fill it out. I don’t know for sure, but I’d guess that can have an impact on someone’s job. If they helped you, why shouldn’t you help out.

Do you have your favourite SR tips? Please share them in the comments.