Custom Choropleth Layer integration with SAP BW Live Connection in SAP Analytics Cloud
The previous blog post gave you an overview of what is needed and how SAP backend systems can be prepared in order to provide business users the option of analyzing data via a Choropleth layer in SAP Analytics Cloud.
The drill down functionality in that standard scenario was based on a hierarchy delivered by SAP (SAPBWWORLDHIERARCHY) and bound to the specific characteristics of it. Instead of using the default hierarchy, some of your projects may have different requirements to visualize KPIs of e.g. particular sales regions or building capacities. This can be realized by creating your own hierarchy for your shapes.
Taking the default choropleth scenario as given, please make sure that everything mentioned in the previous blog post is already in place before you start with the custom choropleth scenario. This blog shows you the steps besides the default scenario.
Please note that the custom choropleth layer functionality is only supported with SAP BW/4HANA 2.0 SP4+.*
1. SAP HANA
2. SAP BW
On the BW side, you need to create, add and adjust a few things in order to link your hierarchy with the shapefiles. The example described in this blog contains three different InfoObjects, building a hierarchy:
Based on the different regions you can drill down to the state and supermarket level.
2a) Lowest granularity – Supermarket
Let´s start with the lowest granularity of the hierarchy and the main characteristic – the Supermarket. Within the BW modeling tools, tab BI Clients of the InfoObject, you need to maintain it as Geographical Type 2 – “Point Data”.
With that type, a few standard attributes like Longitude and Latitude will be automatically added.
As you can see on the screenshot, beside State and Region, 0GEOFEATID is also part of the attribute list. This InfoObject plays only a crucial role in the default scenario, no further actions needed here.
On the lowest granularity, Longitude and Latitude need to be maintained via master data maintenance. InfoObjects on a higher granularity, in the example State and Region, are carriers of the individual shapes and need to be added as navigational attributes only.
2b) Upper levels – State and Region
Coming to the next characteristic – the State. You need to maintain this one as Geographical Type 4 – Shapes and Point Data. That type “combines” type 1 (shapes) and type 2 (point data) and allows you to describe characteristics by a shape and geographical coordinates.
This geographical type offers additional actions:
6. Upload shapefiles
By choosing „Upload shapefiles“, you can upload the shapefile set on the BW server. This can also be done via SAPGUI (Transaction RSDIOBJGISMAINT).
The set consists of three files (they should have the same name):
- .dbf: DBase file contains a table with attributes describing the different states
- .shp: Shapefile contains geographic shapes
- .shx: Link between .shp and .dbase File
You need to enhance the .dbf file by the BW Field and its corresponding values you are referring to (in this case State). The type should correspond to the characteristic type and its internal format.
Please note: For such a task you would need to have kind of a GIS software in place as a text editor is not adequate enough.
The shape represents the different states that you want to render:
After uploading the files, select “Update Geotable” under Actions (similar to figure 6).
These steps need to be repeated for Region as well. The next picture provides you an overview of the different objects and tasks needed around the InfoObject.
After doing all the steps above and back again in SAP Analytics Cloud, you can switch (via Builder Panel of the Geo Widget) from the default hierarchy to your own hierarchy (Region-State):
I hope this helps you to develop and build your own geo stories in SAP Analytics Cloud.