Sunday, 14 August 2016

Blank Totals in Oracle BI Discoverer

Another technical post. This time about how to solve the Blank Totals problem in Oracle Business Intelligence Discoverer:

I worked years ago as an EUL administrator with the Oracle Discoverer tools. We found a problem that troubled us during days: Grand Totals for some columns were empty despite of containing data that should be shown. The info was visible only when there was only one record to be added up but only an empty cell was displayed when there were more than one.

That seemed to us like a glitch or bug in this tool but it came out to be a technical decision of the tool's designers. Let me explain:

When we got two folders related to each other as master-detail but, at the master's folder we have got the numeric field that is going to be added up, we will get into trouble as the addition should add the master records numeric fields as many times as detail items are in our database. That's probably not what we want.

Let's see an example. If we got a master folder with data from official tourist guides, which includes their fares, like this:

Id.     Name       Salary
1       Pedro        2.000€
2       Juan          1.000€
3       Marta        1.500€

And if, on top of this, we have a detail folder, where we get the list of languages spoken by each tourist guide, it would look like this:

Id.     Name       Salary       Language
1           (Pedro)        2.000€          English
2          (Juan)          1.000€           English
2          (Juan)          1.000€           German
2          (Juan)          1.000€           Swedish
3          (Marta)        1.500€           German

When we create a Summary or a Total, Discoverer will show us that Pedro's fare is 2.000€, Marta's 1.500€ but it will display '_____' (blank cell) instead of the Juan's fare. Whether the tool showed a result, it should be 3.000€, but that is not the real fare for Juan. It is only aggregating three amounts as Juan speaks three languages.

There is a few workarounds to fix this:
  1. Maybe the amount being added should not be at the Detail folder. Should the database design be reviewed?
  2. Check if the relation between master and detail folder is 1 to 1 but it is mistakenly set as 1 to many.
  3. If everything above is right, there is one more thing that you can do: Tell Discoverer that it should add up those amounts anyway. To do so, follow these steps:
    1. Activate the 'Show the sum of the values displayed in the contributing cells' option at the Discoverer Desktop settings.
    2. Set the properties AllowAggregationOverRepeatedValues and AggregationBehavior to 1 instead of 0 at the prefs.txt file that you can find in Discoverer server path $ORACLE_HOME\Discoverer\util.
This latter case should be taken being aware of what that implies. Even if it were a perfectly valid solution for the case you are trying to fix, it could exist another report, now or in future, run at the same patched server, which wouldn't allow the administrator to see there is a problem (fan trap) and totals or summary fields are displaying wrong amounts as they are being added up two or more times (like the Juan's fares).

No comments:

Post a Comment