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
If you are already running the default choropleth scenario descripted in the previous blog post, no further steps are needed. If you are new to this topic, please follow SNote 239540.
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.
Hello Arno Klein , thank you for the great post! May I have a question?
I have stumbled upon an issue with Choropleth maps in SAC and was wondering if you could help me find a solution. Our customer would like to analyse sales in different countries using the Choropleth map but there seems to be some areas that SAC does not accept such as Taiwan, Réunion or Palestine.
I am currently developing a story using only an excel file with countries names and coordinates but in the future we are going to create an ABAP CDS view on S4H (where the sales data lies) and then we will connect it with BW query (where we have the country dimension with the coordinates).
Is there any way to analyse areas such as Taiwan in SAC using the Choropleth?
Thank you very much!
Hi Arno, Thanks for the effort. I'm trying to get the Choropleth Map, but I recive the message "Missing BW shape dimension ZSLZCUGIS__0GEOFEATID" when trying to do so. I assume that i did evrything correct, the main IOBJ has the 0GEOFEATID Attribute as navigational attribute, is of GEO type 2 (Points) and 0GEOFEATID was loaded via BW_GEO_FEATURE_ID. The composite provider and the query built on top of it has the Navigation attribute ZSLZCUGIS__0GEOFEATID as free characteristic. I see data with a bubble map but I get the above error when create a choropleth layer. Apart of the above I get a Correlation ID but without any entry in trace of SAC for this ID.
Maybe you came across this message for which I didn't find any note or further details anywhere else. Otherise I would open an OSS message for further investigation.