You are on page 1of 106

Oracle

Business Intelligence 11g Spa3al Integra3on


Antony Heljula Technical Architect
Peak Indicators Limited

Agenda
q q q q q q q q q

Overview of Mapping Capability Oracle Spa6al Architecture Manage Map Data Implemen6ng Your First Map Dening Custom Background Maps Oracle Locator vs Oracle Spa6al Spa6al Interac6ons Spa6al Func6ons within Answers Spa6al Metadata Deployment

Peak Indicators Limited

Overview of Mapping Capability


q q

The ability to embed maps in to Oracle BI Dashboards is an exci6ng new development for OBIEE 11g Report developers have the power to build colourful and interac6ve maps within their BI Dashboards.no coding or technical know-how required!

Peak Indicators Limited

Overview of Mapping Capability Oracle MapViewer


q

Oracle MapViewer is a java applica6on used to render maps on behalf of other applica6ons

Oracle MapViewer is installed as part of the standard OBIEE 11g installa6on It is deployed onto WebLogic. Default URL hSp://[biserver]:9704/mapviewer No extra licenses required for OBIEE customers to render maps

Peak Indicators Limited

Overview of Mapping Capability Crea3ng Maps is Easy!


q

Create an Analysis within Answers as you normally would Then just add a Map view to the Analysis You just need to make sure at least one of the columns can be rendered on a map!

In this example, each Organiza6on Name corresponds to a geographical country and this has been congured for display on a Map by the OBIEE administrator

Peak Indicators Limited

Overview of Mapping Capability Types of Layer

Colour Fill

Bar Graph

Pie Graph

Bubble
Peak Indicators Limited

Variable Shape

Image
6

Overview of Mapping Capability Enabling/Disabling Layers


q

The user can choose which layers to display on the map

Turn o a layer simply by unchecking the corresponding check-box

Peak Indicators Limited

Overview of Mapping Capability Custom Point Layers


q

Custom Point Layers are where the co-ordinates are taken from the Analysis itself

Mapping coordinates can come from any type of data source! Longitude/La6tude co-ordinates can be provided in a single column or separate columns Supported with Bubble, Variable Shape and Image layers

Peak Indicators Limited

Overview of Mapping Capability Interac3on


q

It is possible to interact with Maps just like you can with other any other OBIEE chart

Just click on the area that is of interest

Drill-Down to a lower hierarchy level


Peak Indicators Limited

Ac6on Link to open up a dierent analysis

Overview of Mapping Capability Prin3ng and Downloading


q

OBIEE 11g does support download and print op6ons for Maps:

Powerpoint

PDF

Peak Indicators Limited

10

q Oracle Spa3al Architecture

Peak Indicators Limited

11

Oracle Spa3al Architecture


q

An Oracle Spa6al Architecture will typically consist of the following components:

Oracle Database

Stores the deni6ons of spa6al objects (using special geometry data types) Locator database op6on for querying, ltering, joining spa6al data Spa6al database op6on for manipula6ng and aggrega6ng spa6al data

Oracle MapViewer

A J2EE applica6on used for rendering interac6ve map images and features-of- interest (FOI) Invoked via a series of XML, Java, PL/SQL and Javascript APIs Provides a layer of caching

Oracle MapBuilder

The development tool for MapViewer A graphical Map builder tool that enables you to dene the content and structure of maps and their rendering rules

Peak Indicators Limited

12

Oracle Spa3al Architecture MapViewer


q

The Management screens allow you to perform administra6ve tasks such as :


Congure MapViewer server Congure Map Tiles Congure data sources Clear geometry caches

Peak Indicators Limited

13

Oracle Spa3al Architecture MapBuilder

Peak Indicators Limited

14

Oracle Spa3al Architecture Metadata


q

Each schema on the database has a set of system views to contain the 4 areas of metadata used by MapBuilder/MapViewer:

USER_SDO_STYLES USER_SDO_THEMES USER_SDO_MAPS USER_SDO_CACHED_MAPS

Peak Indicators Limited

15

Oracle Spa3al Architecture with OBIEE Base Map + Layer

Peak Indicators Limited

16

q Spa3al Data-Structures

Peak Indicators Limited

17

Spa3al Data-Structures
q

A common example of spa6al data can be seen in a road map

A road map is a two-dimensional object that contains points, lines, and polygons that can represent ci6es, roads, and county boundaries

The data that indicates the Earth loca6on (such as longitude and la6tude) of these rendered objects is the spa6al data Other types of spa6al data can be stored on the Oracle database:

Computer-aided design (CAD) Computer-aided manufacturing (CAM)

So spa6al does not just mean maps! It can be chip-boards, aircral wings, bridges....

Peak Indicators Limited

18

Spa3al Data-Structures
q

The Oracle Database has a spa6al data-type called SDO_GEOMETRY to store the various Geometric Types:

NOTE: The Oracle Database can now also handle 3D objects


19

Peak Indicators Limited

Spa3al Data-Structures Example


q

Consider the following table which has contains an SDO_GEOMETRY column called GEOMETRY:
CREATE TABLE cola_markets ( mkt_id NUMBER PRIMARY KEY, name VARCHAR2(32), sales NUMBER, geometry SDO_GEOMETRY );

We can then insert some records.....

Peak Indicators Limited

20

Spa3al Data-Structures Example: Dene GEOM Metadata


q

With any spa6al column, the rst thing we need to do is insert a record into the USER_SDO_GEOM_METADATA to tell the database what type of spa6al data is stored in the column. In our example:

A 20 x 20 grid Tolerance of 0.005 (maximum precision)


INSERT INTO user_sdo_geom_metadata (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)

VALUES ( 'cola_markets', 'geometry', SDO_DIM_ARRAY( SDO_DIM_ELEMENT('X', 0, 20, 0.005), SDO_DIM_ELEMENT('Y', 0, 20, 0.005) ), NULL );

-- 20X20 grid

Peak Indicators Limited

21

Spa3al Data-Structures Example: Rectangle


q

A Rectangle:
INSERT INTO cola_markets VALUES( 1, 'cola_a', 100, SDO_GEOMETRY( 2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,3), SDO_ORDINATE_ARRAY(1,1, 5,7)

-- two-dimensional polygon

-----

one rectangle (1003 = exterior) only 2 points needed to define rectangle (lower left and upper right) with Cartesian-coordinate data

) );

Peak Indicators Limited

22

Spa3al Data-Structures Example: 2 Simple Polygons


q

2 Simple Polygons, each with 5 points:


INSERT INTO cola_markets VALUES( 2, 'cola_b', 200, SDO_GEOMETRY( 2003, -- two-dimensional polygon NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,1), -- one polygon (exterior polygon ring) SDO_ORDINATE_ARRAY(5,1, 8,1, 8,6, 5,7, 5,1) ) ); INSERT INTO cola_markets VALUES( 3, 'cola_c', 300, SDO_GEOMETRY( 2003, -- two-dimensional polygon NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,1), -- one polygon (exterior polygon ring) SDO_ORDINATE_ARRAY(3,3, 6,3, 6,5, 4,5, 3,3) ) );

Peak Indicators Limited

23

Spa3al Data-Structures Example: Circle


q

A Circle:
INSERT INTO cola_markets VALUES( 4, 'cola_d', 400, SDO_GEOMETRY( 2003, NULL, NULL, SDO_ELEM_INFO_ARRAY(1,1003,4), SDO_ORDINATE_ARRAY(8,7, 10,9, 8,11) ) );

-- two-dimensional polygon

-- one circle -- 3 points needed

Peak Indicators Limited

24

Spa3al Data-Structures Example: Spa3al Index


q

Then nally we need to create a Spa6al Index on the SDO_GEOMETRY column:


CREATE INDEX cola_spatial_idx ON cola_markets(geometry) INDEXTYPE IS MDSYS.SPATIAL_INDEX;

Peak Indicators Limited

25

Spa3al Data-Structures Example: The Result

Peak Indicators Limited

26

Spa3al Data-Structures Example: The Result in OBIEE!


q

MapViewer isnt just for displaying road maps!

Peak Indicators Limited

27

Spa3al Data-Structures A Country?!


q

A Country is simply a more complex polygon with many coordinates, and will be based on Geode6c Coordinates i.e. Longitude and La6tude

Longitude coordinates range from -180 to 180 La6tude coordinates range from -90 to 90 NOTE: the previous example which was based on Cartesian Coordinates

Here the whole geometry for the UK border is stored in a single record:

Peak Indicators Limited

28

q NAVTEQ Digial Maps

Peak Indicators Limited

29

NAVTEQ Digital Maps


q

One method of rendering maps within OBIEE 11g is to have all your spa6al data stored in an Oracle Database Spa6al data is stored in the Oracle Database using a special spa6al data type called SDO_GEOMETRY

As an example, If you want to render Country boundaries you will have a table that stores the geometries for each Country

This map will consist of many dierent sets of geometries all layered on top of each other:

Country Boundaries Ocean Boundaries City Loca6ons Highways State Boundaries Lakes etc

Peak Indicators Limited

30

Maps NAVTEQ Sample Maps


q

NAVTEQ sample map data is available for download (with install instruc6ons) from OTN:

hSp://www.oracle.com/technology/solware/products/mapviewer/index.html

Data provided goes down to postcode level in 3 loca6ons:


London San Francisco Sydney

q q

Maps covering further detail can be purchased directly from NAVTEQ Digital map data is approx 300MB in size

Peak Indicators Limited

31

q Spa3al Reference Iden3er (SRID)

Peak Indicators Limited

32

Spa3al Reference Iden3er (SRID)


q

An SRID (Spa6al Reference IDen6er) is an integer value which describes the type of coordinate system being used by a spa6al engine When you build a map, you need to state the SRID. The SRID is largely dependent on the map provider The database table MDSYS.CS_SRS contains the complete list of dierent coordinate systems

There are over 4,500 dierent coordinate systems listed by 156 dierent organiza6ons Oracle has 996, which is more than anyone else!

The most common one used by Oracle is 8307 which refers to a specic Longitude/ La6tude coordinate system (Google Maps uses 3785)

Peak Indicators Limited

33

q Manage Map Data

Peak Indicators Limited

34

Manage Map Data


q

The OBIEE 11g Administra6on screen contains a new op6on that allows you to congure your map data:

Manage Map Data

Peak Indicators Limited

35

Manage Map Data Layers


q

First of all, you dene one or more Layers that can be rendered on top of a map. Layers can be either:

Points Polygons

In order to use maps with OBIEE, you must have at least one Layer

Import / Delete / Edit Layer op6ons

Peak Indicators Limited

36

Manage Map Data Impor3ng Layers


q

When you choose to import a new Layer, OBIEE will obtain the Layers that exist within the data source you choose

The Layers listed correspond to the Themes you dened in MapBuilder which are stored in the table USER_SDO_THEMES

Peak Indicators Limited

37

Manage Map Data Edit Layer


q

Once the Layer is imported, you can edit congure it for use with OBIEE:

Specify Geometry Type (Either Point or Polygon) Specify which Subject Area columns can be used for this layer (i.e. which columns can be used to join to the spa6al data)

In this example, the Layer is keyed on ORGANIZATION. This means we can link it to the Organiza6on Name column in three Subject Areas: Sales Forecast Sales Orders Service Incidents

Peak Indicators Limited

38

Manage Map Data Background Maps


q

Once your Layers have been dened, you can import Background Maps and then congure which Layers can use them:

Import / Delete / Edit Background Maps

Peak Indicators Limited

39

Manage Map Data Impor3ng Background Maps


q

When you choose to import a new Background Map, OBIEE will obtain the Map Tile Layers that exist within the data source you choose

The maps listed correspond to the same Map Tiles which are dened in MapViewer, and are stored in the database table USER_SDO_CACHED_MAPS

Peak Indicators Limited

40

Manage Map Data Edit Background Maps


q

Once the Background Maps is imported, you can edit congure it for use with OBIEE:

Specify which Layers can use the map, and at which zoom levels Congure the order in which the Layers appear on top of each other on a map

This Background Map has 3 Layers, with OBIEE_CUSTOMERS displayed on top of the others

Peak Indicators Limited

41

Manage Map Data Images


q

You can import your own custom Images for use on your maps

When you choose to import an image, the images listed correspond to the images dened within MapBuilder and are stored in the database table USER_SDO_STYLES

Peak Indicators Limited

42

q Implemen3ng Your First Background Map

Peak Indicators Limited

43

Implemen3ng Your First Map Demonstra3on

Peak Indicators Limited

44

q Dening Custom Background Maps

Peak Indicators Limited

45

Dening Custom Background Maps


q

There are several reasons why you may wish to dene custom Background Maps:

You wish to use a dierent provider other than NAVTEQ Your company may already have its own map data You need to customise the exis6ng NAVTEQ maps e.g. reduce the number of Themes to improve performance or reduce cluSer You prefer to use an external map provider on the internet, rather than having your maps stored in the underlying Oracle database

If you wish to use further custom Background Maps with OBIEE, you have the two op6ons:

Internal Maps External Maps

(using MapBuilder) (using a Web Map Service provider)

Peak Indicators Limited

46

Dening Custom Background Maps

Use an external provider e.g. integrate with a Web Map Service (WMS) provider

Use MapBuilder to dene further internal Background Maps. The metadata is stored in the database

Peak Indicators Limited

47

Dening Custom Background Maps Note


q q

Note that map providers such as Google Maps are not yet supported MapViewer does actually have the capability to integrate with Google Maps and other such providers, but at the moment OBIEE 11g only supports providers who deliver their maps via Web Map Services

Peak Indicators Limited

48

q Internal Background Maps

Peak Indicators Limited

49

Internal Background Maps


q

You can use MapBuilder to dene further custom Background Maps for use with OBIEE. The rst thing you do is dene a new Base Map A Base Map is made up of one or more Themes:

You dene the order in which the Themes overlay on top of each other You dene the scale ranges to state when the Themes should appear (if you are zoomed out then you might want to hide roads, ci6es etc)

The default WORLD_MAP provided by NAVTEQ is made up from over 300 Themes!

Peak Indicators Limited

50

Internal Background Maps Example


q q q

In our example, we are going to create a new Base Map called WORLD_MAP_OBIEE This will be similar to the default NAVTEQ WORLD_MAP but with a signicantly reduced number of Themes We will use this new Base Map later on in the training when we report at Country and Region level, where we are not interested in seeing roads, ci6es, etc The Base Map will be formed of just two Themes:
M_OCEANS_S01 M_ADMIN_AREA1_S01

Peak Indicators Limited

51

Internal Background Maps Create Base Map


q

You can create a new Base Map using the following op6on:

Base Maps > Create Base Map

Peak Indicators Limited

52

Internal Background Maps Choose Themes


q

Specify the Themes you wish to use, star6ng with the boSom layer

Peak Indicators Limited

53

Internal Background Maps Preview


q q

Click Finish to complete the crea6on Go to the Preview tab and view your new Base Map!

Peak Indicators Limited

54

Internal Background Maps Create Map Tile Layer


q

Now our Base Map is complete, we need to deploy it to MapViewer by crea6ng a Map Tile Layer

Peak Indicators Limited

55

Internal Background Maps Tile Layer Bounds


q

Choose the SRID (typically 8307 for an Oracle Spa6al map) and the X/Y coordinate ranges

Click Update from Map to auto-populate these entries

Peak Indicators Limited

56

Internal Background Maps Zoom Levels


q

Next you have to dene your zoom levels the easiest way to do this is the zoom in/out on the map shown at the top and click the From Map buSon when you are at the appropriate Minimum/Maximum zoom level You can then set the # Zoom Levels and click Generate to generate all the levels of zoom you wish to have in between the Minimum/Maximum scales

Peak Indicators Limited

57

Internal Background Maps Tile Proper3es


q

Under normal circumstances you can choose the default Tile Proper6es congura6on:

Specify a default background colour if you wish to have one:

Peak Indicators Limited

58

Internal Background Maps Tile Layer Complete


q

Thats it! Click Finish to save the metadata in the database where it can be accessed by MapViewer

Peak Indicators Limited

59

Internal Background Maps MapViewer


q

You should be able to log onto MapViewer and see the new Map Tile Layer listed straight away:

Peak Indicators Limited

60

q External Background Maps

Peak Indicators Limited

61

External Background Maps


q

It is possible to create Map Tile Layers in MapViewer from external Base Maps External Base Maps are maps which are sourced from somewhere other than your own internal Oracle database We shall show an example where we will create a new Map Tile Layer within MapViewer that is sourced from the OpenStreetMap Web Map Services (WMS) provider Wikipedia:

A Web Map Service (WMS) is a standard protocol for serving georeferenced map images over the Internet that are generated by a map server using data from a GIS database.[2] The specica6on was developed and rst published by the Open Geospa6al Consor6um in 1999

Peak Indicators Limited

62

External Background Maps Create Map Tile Layer


q

Within MapViewer, on the Manage Map Tile Layers screen choose the Create op6on Select External as the type of map source

Peak Indicators Limited

63

External Background Maps Specify Parameters : Name/Data Source


q q

You will now be prompted for a number of parameters First of all, specify the name of your new Map Tile Layer and the data source in which you will store the Map Tile Layer deni6on:

Peak Indicators Limited

64

External Background Maps Specify Parameters : Map URL and Java Class
q

Specify the Map service URL and Java Adapter Class / Jar le

These should be provided to you by the WMS provider Map Service URL: Adapter class: Jar le loca6on: hSp://osm.wheregroup.com/cgi-bin/mapserv mcsadapter.WMSAdapter [OBIEE_Home]/Oracle_BI1/bifounda6on/jee/ mapviewer.ear/web.war/WEB-INF/6leserver/mvadapter/ mvadapter.jar

You should be able to see this JAR le within your MapViewer deployment loca6on

Peak Indicators Limited

65

External Background Maps Specify Parameters : Adapter Proper3es


q

Enable the Adapter Proper6es op6on and add proper6es as required by your WMS provider:

service: srs: format: map: layers:

WMS EPSG:4326 image/png /data/umn/osm/osm_basic.map OSM_Basic

Our WMS provider has uses SRID coordinate system 4326

Peak Indicators Limited

66

External Background Maps Specify Parameters : SRID


q

Enter the coordinate system that you would like your Map Tile Layer to use:
NOTE: Your WMS provider is likely to use a dierent SRID to Oracles 8307, but MapViewer will translate the WMS providers map data into the coordinate system you provide here. So if you use 8307 elsewhere in the system then you need to specify that here. Transla6ng the map data into 8307 will degrade performance, the only alterna6ve is to translate all your spa6al data to use the same coordinate system as your provider!

Peak Indicators Limited

67

External Background Maps Submit


q q

Click the Submit buSon to nish the crea6on of your external Map Tile Layer Try previewing it!

Peak Indicators Limited

68

External Background Maps Test!


q

You should be able to immediately test out the new Background Map on your OBIEE Dashboards:

Peak Indicators Limited

69

q Oracle Locator vs Oracle Spa3al

Peak Indicators Limited

70

Locator vs Spa3al
q

Oracle Locator

Locator is a cut-down version of Oracle Spa6al and is provided free with the database Standard and Enterprise Edi6ons It provides as set of spa6al capabili6es for applica6on developers:

Spa6al indexing capabili6es Func6ons for joining and ltering spa6al data General u6li6es e.g. valida6ng spa6al data

Locator should be sucient for most of our BI implementa6ons unless, for example, the digital map data being used at the customer site needs to manipulated or aggregated in some way

Oracle Spa3al

Spa6al is a licensed database op6on and is only available with Enterprise Edi6ons It provides the Locator func6onality plus all geometry func6ons for spa6al aggregate, spa6al analysis and mining func6ons, linear referencing system support and geo-coding

Peak Indicators Limited

71

Locator vs Spa3al
q

Locator and Spa6al func6ons/objects are created within the MDSYS schema on the Oracle database It is not immediately obvious which features are Locator (free) and which require a Spa6al license It is important therefore to refer to the following document which outlines the Locator/Spa6al features:

hSp://download.oracle.com/docs/cd/B28359_01/appdev.111/b28400/sdo_locator.htm#i632018

As a general rule: If you are manipula6ng spa6al data in any way then you probably require a Spa6al license!

Peak Indicators Limited

72

U3lising Oracle Locator Oracle Locator Func3ons


q

Oracle Locator provides many func6ons that can help in a situa6on like this see the documenta6on for more details

hSp://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_operat.htm#i76448

Peak Indicators Limited

73

U3lising Oracle Locator Locator Example


q

The SDO_CONTAINS locator func6on is being used here to determine which countries are associated with a set of longitude/la6tude co- ordinates:
SELECT FROM WHERE AND f.geometry, d.country w_case_f f, w_country_d d f.country_wid = d.row_wid SDO_CONTAINS(d.country_geom,f.geometry) = 'TRUE'

Peak Indicators Limited

74

U3lising Oracle Spa3al Oracle Spa3al Func3ons


q

Oracle Spa6al provides a range of spa6al aggregate func6ons that can help in a situa6on like this see the documenta6on for more details

hSp://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_aggr.htm#g998149

REMEMBER! You need a license for Oracle Spa6al to use any of these func6ons

Peak Indicators Limited

75

U3lising Oracle Spa3al Spa3al Example


q

The SDO_AGGR_UNION Spa6al aggregate func6on is being used here to aggregate all the Country geometries together to form larger Regions:
UPDATE w_region_d d SET region_geom = (SELECT SDO_AGGR_UNION(SDOAGGRTYPE(country_geom, 0.0000005)) FROM w_country_d WHERE region = d.region);

Peak Indicators Limited

76

q Spa3al Interac3ons

Peak Indicators Limited

77

Spa3al Interac3ons
q

One of the key benets that comes with OBIEE 11gs mapping capability is the ability to interact with the maps just like they were standard Table/ Chart views

Peak Indicators Limited

78

Spa3al Interac3ons Info Window


q

When you click on the map, an info window will appear displaying informa6on about the polygon/point you just clicked on

you can congure this info window to display extra columns

Peak Indicators Limited

79

Spa3al Interac3ons Drill-Downs : Heading


q

By default, you will get the same default Drill-Down interac6ons as you get with any other Table/ Chart If you click on Business Group then you will drill-down just as if you clicked on the Business Group column heading on the table underneath the map

You should see all Organiza6ons being returned

Peak Indicators Limited

80

Spa3al Interac3ons Drill-Downs : Heading


q

By clicking on the Business Group link we get a new map showing data by all the child Organiza6ons Note how the Table underneath the map has also changed to list data for all Organiza6ons

Peak Indicators Limited

81

Spa3al Interac3ons Drill-Downs : Value


q

Now this 6me we shall instead click on Vision Nordics We should drill-down just as if had clicked on the Vision Nordics value in the table underneath the map

You should see all Organiza6ons being returned for Vision Nordics

Peak Indicators Limited

82

Spa3al Interac3ons Drill-Downs : Value


q

And heres the result! We get a new map showing just the Organiza6ons for Vision Nordics NOTE:

The map zoomed in automa6cally!

Peak Indicators Limited

83

Spa3al Interac3ons Master-Detail Linking


q

Master-Detail linking works even from maps as well!

Clicking on the map will ini6ate a Master-Detail event to change the data displayed in the Graph

Peak Indicators Limited

84

Spa3al Interac3ons Ac3on Links


q

It is also possible to set up Ac6on Links for your maps for naviga6on between dashboards/analyses:

Peak Indicators Limited

85

q Spa3al Func3ons within Answers

Peak Indicators Limited

86

Spa3al Func3ons within Answers


q

The Oracle Spa6al database with its Locator/Spa6al func6ons provide a huge array of spa6al analysis capability It would be good to be able to use it from Answers! OBIEE does not have any built-in spa6al func6ons, but using the EVALUATE func6ons we are able to call database spa6al func6ons directly from within Answers! We will be looking at two scenarios:

Calcula6ng the distance between your chosen loca6on and the customers Retrieving data only where the customer is within a specic distance from your chosen loca6on

Peak Indicators Limited

87

Spa3al Func3ons within Answers Example Database Func3on


q

A func6on obiee_distance has been created on the database It accepts two parameters:

The long/lat of the city loca6on is retrieved from the NAVTEQ data

A city loca6on A customer name

The long/lat of the customer loca6on is retrieved from our data warehouse

It then uses the spa6al func6on SDO_DISTANCE to return the distance between the two loca6ons

The func6on returns the distance (in KM) between the two geometry coordinates

Peak Indicators Limited

88

Spa3al Func3ons within Answers Example Database Func3on


q

For example, we can call the obiee_distance func6on to show that the Department of Jus6ce is 5.76km from London

Peak Indicators Limited

89

q Column Formulas

Peak Indicators Limited

90

Column Formulas
q

We are going to congure a Dashboard Page to allow the user to choose a city loca6on, the Analysis will then show the distance (in KM) between the users loca6on and each customer listed on the report

To work out the distance, we will execute our db func6on obiee_distance

Peak Indicators Limited

91

Column Formulas Create Dashboard Prompt


q

First of all, create a Dashboard Prompt to list all the City Loca6ons

You can use a new Variable Prompt to specify a custom list of loca6ons

Congure the prompt to populate a Presenta6on Variable e.g. PR_LOCATION

Peak Indicators Limited

92

Column Formulas Congure Analysis


q q q

Then open up your Analysis for edi6ng Add a new column called Distance from your loca6on (KM) Use the following column formula:

EVALUATE('obiee_distance(''@{PR_LOCATION}{LONDON}'',%1)' AS DOUBLE, "Customer"."Customer Name")

Peak Indicators Limited

93

Column Formulas Preview Results


q

Changing your loca6on using the Dashboard Prompt will change the distances between you and the customer!

Peak Indicators Limited

94

q Column Filters

Peak Indicators Limited

95

Column Filters
q

Well now add a lter to the Analysis that will allow the user to return only customers that are within a chosen distance of their chosen loca6on:

Peak Indicators Limited

96

Column Filters Create Dashboard Prompt


q

First of all, add a new column to your Dashboard Prompt to allow the user to enter a number value (the distance in km) Congure the prompt to populate a Presenta6on Variable e.g. PR_DISTANCE

Peak Indicators Limited

97

Column Filters Add Filter to Analysis


q

Within Answers, choose to lter on the column which calculates the distance between your chosen loca6on and the customer:

Peak Indicators Limited

98

Column Filters Congure Filter


q

Congure the lter so that the distance value must be less than the presenta6on variable PR_DISTANCE (default 1000):

Peak Indicators Limited

99

Column Filters Test Analysis


q

Return to the Dashboard Page and test your new lter!

Peak Indicators Limited

100

q Spa3al Metadata Deployment

Peak Indicators Limited

101

Custom Map Metadata


q

Each schema on the database has a set of system views to contain the 4 areas of metadata used by MapBuilder/MapViewer:

USER_SDO_STYLES USER_SDO_THEMES USER_SDO_MAPS USER_SDO_CACHED_MAPS

Peak Indicators Limited

102

Custom Map Metadata


q

As these 4 tables are System Views on the database, you cannot export/ import them directly To migrate the metadata in these 4 tables, you have to run a 4 step process:
1. 2. 3. 4.

Copy the metadata into 4 Temporary Tables Export the 4 Temporary Tables Import the 4 Temporary Tables into your target environment Insert the metadata from the Temporary Tables into the System Views

Peak Indicators Limited

103

Custom Map Metadata Examples


1.

Crea6ng 4 Temporary Tables on dev:


CREATE CREATE CREATE CREATE TABLE TABLE TABLE TABLE temp_sdo_cached_maps temp_sdo_maps temp_sdo_styles temp_sdo_themes AS AS AS AS SELECT SELECT SELECT SELECT * * * * FROM FROM FROM FROM USER_SDO_CACHED_MAPS; USER_SDO_MAPS; USER_SDO_STYLES; USER_SDO_THEMES;

3.

Export from dev:


exp appsdw/appsdw@dev file=appsdw.dmp tables=temp_cached_maps,temp_maps,temp_styles,temp_themes

3.

Import into prod:


imp appsdw/appsdw@prod file=appsdw.dmp

4.

Inser6ng the Metadata into your prod System Views:


INSERT INSERT INSERT INSERT COMMIT; INTO INTO INTO INTO USER_SDO_CACHED_MAPS USER_SDO_MAPS USER_SDO_STYLES USER_SDO_THEMES SELECT SELECT SELECT SELECT * * * * FROM FROM FROM FROM temp_sdo_cached_maps; temp_sdo_maps; temp_sdo_styles; temp_sdo_themes;

Peak Indicators Limited

104

q Ques3ons?

Peak Indicators Limited

Helping Your Business Intelligence Journey

Peak Indicators Limited

You might also like