Thursday, March 14, 2019

Simple integration of Data Visualization in OBI Dashboard

In OBIEE and OAC (Oracle Analytic Cloud) we can easily integrate Data Visualization projects with Dashboard Prompt capabilities. That works both with Subject Areas and Data Visualization Data Sources.

Lets do 2 examples. Subject Area based and Data Source Based.

Example 1:

Lets create a simple Data Visualization based on Subject Area:

In a dashboard I can add the project as any other OBI component:

Please note you can set size of the project within the Dashboard and select the Canvas you need, assuming you have more than one (Show View).

Next I can create a regular Dashboard Prompt. Please note we don't have to do anything. As long as the prompt based on the same Subject area as the Project it would work. In my case I created the Prompt "Offices"."D2 Department" column. Note the "Offices" don't participate in the Project.

Last thing I do is to place both on the same Dashboard page, and it just works:

Changing the selection in the Prompt, changes the filter in the Project and we can see different values in our data (and other expected changes, such as graph scales change):

Example 2

We can do the same with Data Set based Projects:

I'll use the Sample Project.

When creating the Dashboard Prompt I can see the Data Set data sources and not only Subject Areas, so I will use it:

Again, we can use both in a Dashboard, and it just works, with no additional effort.

Tuesday, October 2, 2018

Oracle Data Visualization and the Attribute function

The Attribute function is an important function of Oracle Data Visualization, useful when we attempt to create something interesting based on measure values. It was covered by Philippe Lions in the post "Leverage the 'Attribute' Function to Boost Data Insights", but I want to dig a bit deeper and show a simple use case.

First example why we need it:

 I want to create 2 groups one with profit over 500 and the other with 500 and bellow. So I create the following calculation :

In our case I used City and few measures (Row Count and Profit), as a result I have each city assigned to group:

In many cases I jut want the totals, for each group. So I'll remove the city and get a strange result:

What happened?  Our 'Case 1' is treated as a measure and aggregated!

In Answers we had an option to mark "Treat as an attribute column":
but in Answers we have many layers, this part is in criteria, and we don't really have it in data visualization that uses more direct and simple approach.  

The Attribute function should solve this problem.  

The explicit syntax for this function is:  
ATTRIBUTE(<expression> BY <attribute list> WHERE <predicate>)  

The BY clause may be empty, in which case grand total grain is assumed.

I will return to our example. Instead of case when Profit>500 then 'Group A' else 'Group B' end
I will use case when Attribute(Profit by City)>500 then 'Group A' else 'Group B' end
And replace the Case 1 with Case 2:


Lets talk a bit about the BY part:

The Profit or any other measure is summarized according to the BY clause. In  our case we wanted to summarize it by City. If we want it on any other level we should define it.

For example in my data the primary key of the data is Order ID and Order Line ID. We can use them in the BY clause:
In this case the profit is summarized by the lowest level of the data grain and return different results:

But this is exactly the case when we can omit the BY clause and get exactly the same result:

The wrong way to use Attribute function:

From what I have seen, the attribute function should be used as close to the measure as possible. For some reason, people (me including) tend to do it the other way, which seems to be the wrong way.

In our example using Attribute function outside the Case function:

Will get you an error with some advise

this can be resolved by having an administrator refresh the server metadata.

You don't have to, just keep the Attribute function close to the measure as described above.

If, for some reason, you insist on this approach, the workaround is to use numeric values as result.

Or you can always use some cast function on top of it.

It will work:

Did I mention it's an ugly and not recommended approach?

Monday, July 23, 2018

Adding Your own cities to Oracle DV - for the clueless

The aim of this post is to add your own cities to the Oracle geo-Json files in Oracle Data Visualization (DV). There are lots of smart options to create the geo files, that were already covered (extracting from Oracle database map, converting from maps Shapefile, based on image ...) this post describes how clueless person can do it with Excel.
This post is relevant for most types of Oracle Data Visualization (including desktop, OAC - cloud, on-prem). It was "quick and dirty" work and naturally can be greatly improved.


There are 3 layer when you work with maps and DV.
  1. The background map (such as Google Maps, Oracle Maps...) 
  2. Your Data that contains information such as country or city names.
  3. A layer that translates your data to geographical info such as specific location (lat&long point) or borders (a set of lat&long points). This layer is created in Oracle DV using geo-Json files.
We can see the existing maps/geo-json files in the Console:

You can see them as physical files as well. The DV desktop files are located in: C:\Users\YOUR_USER_NAME\AppData\Local\Temp\DVDesktop\config\fmwconfig\biconfig\catalogs\basemaps   (replace YOUR_USER_NAME with your windows user name)

In the file world_cities.json, a single city in this file looks like this: {"type":"Feature","_id":"293394","geometry":{"type":"Point","coordinates":[34.76807,32.08194]},"properties":{"City Name":"Tel Aviv-Yafo","ISO":"ISR","Country Name":"Israel","State Name":"Tel Aviv","Scalerank":"2","Country Code_State Province Name_City Name":"ISR_Tel Aviv_Tel Aviv-Yafo","Country Name_State Province Name_City Name":"Israel_Tel Aviv_Tel Aviv-Yafo","Country Name_City Name":"Israel_Tel Aviv-Yafo","Country Code_City Name":"ISR_Tel Aviv-Yafo"}},

In this case we translate the City Name (Tel Aviv-Yafo) to coordinates :[34.76807,32.08194]

The system finds your data and scans existing map files for it, then translates it to geo-location. As a result you can have the same point with multiple name(Tel Aviv-Yafo, Tel Aviv, Tel Aviv Yafo, TA-Israel....) including translation to your local languages...The system would work fine! The one thing that is best not to do is to have 2 rows with the same City Name.

So I wanted to take the existing world_cities.json and add all the locations in Israel, in English, Hebrew and Arabic. The original file has few cities in English names.

How do I find possible location? Google it! There are plenty of people that published free relevant data to your country, or you can right click a map such as google map and copy manually the location coordinates or get it from the URL (for example,34.76807,17z), just note in google the order is [lat, long] in our geo-json file it's [long,lat].
It's always a good idea to check first at Oracle Analytics store - Maps & Spatial. Maybe someone already did the hard work.


To make thing extra easy I created an Excel file with a set of calculations. All I care about is filling the first 6 columns: running number, City Name, State Name, Country Code, country name and Long,Lat. the result is column G that is result you want to add to world_cities.json. 
The excel file is located here.
Just delete the values in columns B, C, D, E, F
Copy line 2 (columns A - AG) to the bellow lines
Add your own data as described above:
B - City Name
C - State Name
D - Country Code
E - Country Name
F - Long,Lat

Copy column G result and Paste it as Values.
Add the Values to world_cities.json, before the last line (our data has a comma at the end of the line, it can't be the last data line).

Here is am example file world_cities-HEB.json with 76 major cities in Israel added in English, Hebrew and Arabic.
Here is an example of world_cities_Hebrew_All_Israel.json with over 1000 places in Israel added, only in Hebrew.

Of course if you don't need all the wold cities and need only the local cities for your case you can create your own smaller json file without the world cities, based on world_cities.json file structure (in that case you can greatly simplify the attributes list, if you want).

Last step is to upload the files as custom map layers.

For the DV Desktop or OAC (Oracle Analytic Cloud) we can upload the file using the Console:

Press "Add Custom Layer (click, or drag and drop GeoJSON file)"
Select the json file.
You are required to select Layer Keys. Select the "City Name" at least:

Now you can use this in your maps:

Most likely the layer would be selected automatically. You can manually select your preferred layer option in properties any way.

You can find the same in OAC. Check the Console for Maps or use the URL similar to:

Monday, April 23, 2018

obiee is available

OBIEE was released this weekend. 
The download page is here.

The installation includes:

The unexpected component is the patches for the weblogic server that should be installed before installing the BI. Oracle advises to install them when upgrading from previous 12c.

The JDK and Weblogic components seem to be the same as for

At the moment the BI Client seems to be rather big download file. When I opened it I discovered another copy of the BI server software, beyond the expected client software.  So if you are installing OBIEE Windows server...

The new features are mainly major upgrade of the Data Visualization component, described here.

Data Visualization new features:

 Publisher new features:

 Specifying the Barcode Types in RTF Templates.You can use the qrcode or PDF417 functions to specify the barcode type in the RTF templates. See 2D Barcode Functions.
  • Creating Accessible PDF Documents.You can create structured accessible PDF documents that include the document title and PDF tags. See Generating Accessible PDF Output.
  • Skipping Pages and Page Numbers in Reports.You can create a RTF template to skip pages and page numbers in the first page, even pages, or odd pages in reports. See Skipping Pages and Page Numbers.
  • Enable Diagnostic Logs for Online Reports.You can enable diagnostic logs for online reports. See Enabling Diagnostics for Online Reports.
  • Purge Scheduled Job History Data.You can purge the history of old scheduled jobs. See Purging Job History.
  • Set Memory Guard Property for Bursting Data Size.You can set the server.BURSTING_REPORT_MAX_DATA_SIZE memory guard property to limit the size of bursting data. See Memory Guard Properties.
  • Generate Command-Line Utilities.You can run the GenerateBIPUtility script to generate the utilities for configuring memory guard properties (BIPCONFIGSERVICE.ZIP) and for managing catalog (BIPCATALOGUTIL.ZIP). See Using Command-Line Utilities.

 OBIEE new features:

  • This release includes the Manage Themes functionality, which allows the entire interface, dashboard styles, or both to be customized with a logo, colors, link appearance, and button shape. See Modifying the User Interface With Themes.