
Figure 1: Example Choropleth
Figure 1.0: Download the latest GEO CONTENT ANALYTICS CLD
Figure 1.1: Upload Files
Figure 1.2: SAP Supplied Spatial MTARs
Figure 1.3: Deploy MTA Archive
Figure 1.4: FPA_SPATIAL_DATA.mtaext
_schema-version: "3.0.0"
ID: MY_DATABASE_ID_FOR_FPA_SPATIAL_DATA
description: Provides the HANA Cloud Database ID to deploy the shape data for SAC choropleth layer
extends: FPA_SPATIAL_DATA
resources:
- name: FPA_SPATIAL_DATA-hdi
parameters:
config:
database_id: <insert your database ID here>
Figure 1.5: SAP_FPA_SPATIAL_CUSTOM_REGIONS.mtaext
_schema-version: "3.0.0"
ID: MY_DATABASE_ID_FOR_SPATIAL_CUSTOM_REGION
description: Provides the HANA Cloud Database ID to deploy the custom hierarchy table for use with SAP Analytics Cloud
extends: SAP_FPA_SPATIAL_CUSTOM_REGIONS
resources:
- name: SAP_FPA_SPATIAL_CUSTOM_REGIONS-hdi
parameters:
config:
database_id: <insert your database ID here>
cd mta_archives
mta_archives $ cf deploy FPA_SPATIAL_DATA_1.1.24.mtar -e FPA_SPATIAL_DATA.mtaext
mta_archives $ cf deploy FPA_SPATIAL_CUSTOM_REGIONS_1.0.0.mtar -e FPA_SPATIAL_CUSTOM_REGIONS.mtaext
Figure 1.6: cf deploy command FPA_SPATIAL_DATA_1.1.24.mtar
Figure 1.7: Deployment in-progress
Figure 1.8: Deployment Finished
# Viewing Spatial choropleth
GRANT FPA_SPATIAL_DATA."FPA_SPATIAL_DATA::PublicAccessObjects" TO I049374;
GRANT SAP_FPA_SPATIAL_CUSTOM_REGIONS."sap.fpa.services.spatial::ViewerRole" TO I049374;
# Editing & Creating custom choropleth layers
GRANT SAP_FPA_SPATIAL_CUSTOM_REGIONS."sap.fpa.services.spatial::EditorRole" TO I049374;
create PUBLIC synonym SAC_CHOROPLETH_DATA for "FPA_SPATIAL_DATA"."FPA_SPATIAL_DATA.choropleth::CHOROPLETH" ;
create PUBLIC synonym SAC_CHOROPLETH_HIER for "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial.choropleth::CHOROPLETH_CUSTOM_HIERARCHY" ;
Figure 1.9: Enable Choropleth Layer
2.1 Prepare shape data
2.2 Expose shape data as dimension calculation view
2.3 Update SAC Metadata with details of new dimension calculation view
2.4 Create Choropleth Geo Map in SAC
Column Name | Data Type | Description |
ID | INT | Primary Key |
NAME | VARCHAR(100) | SAC Display Name for Shape/Region |
SHAPE | ST_GEOMETRY(3857) | This the choropleth shape |
SHAPEPOINT | ST_POINT(3857) | Centre of the Shape, can be calculated with ST_Centroid() see SQL below. |
IS_LEAF | BOOLEAN | Usually false. True/false flag to specify whether or not to drill directly to the data points. |
CREATE COLUMN TABLE ENGLAND_L1 (ID INT PRIMARY KEY, NAME VARCHAR(100), SHAPE ST_GEOMETRY(3857), SHAPEPOINT ST_POINT(3857), IS_LEAF BOOLEAN);
INSERT INTO ENGLAND_L1
SELECT ROW_NUMBER() Over () as "ID" ,"rgn19nm" as "NAME", SHAPE.ST_Transform(3857) as SHAPE, SHAPE.ST_Transform(3857).ST_Centroid() as SHAPEPOINT, false AS IS_LEAF FROM "England-Regions";
Figure 2.1: Data Preview of SHAPE table
Figure 2.2.1: Create SAP HANA Database Artifact
Figure 2.2.2: Dimension Calculation View
SELECT * FROM "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY";
Figure 2.3.1: "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY"
INSERT INTO "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY" VALUES(
'English Regions' /* NAME: Hierarchy display name shown in SAC */,
2 /* HIERARCHYID: Hierarchy ID */,
'NAME' /* COLUMN: Column storing the shape label name to show in SAC */,
'name' /* COLUMNLABEL: use text 'name' */,
6 /* ID: Unique ID for for Shape or layer */,
1 /* LEVEL: Level in Hierarchy, can use 1, 2, 3 or 1.1, 1.2 */,
'English Region' /* LNAME: Layer display name shown in SAC */,
'SHAPE' /* LOCATION: Column storing the Shape ST_GEOMETRY Label */,
'ENGLAND_REGIONS_L1' /* OBJECT:, Dimensional Calculation View Name */,
'' /* PACKAGE: Repository Package, Not used in HANA Cloud */,
'GCOE' /* SCHEMA: SCHEMA/HDI Container storing the Calculation View */,
'0' /* DEFAULT: 0 for custom regions, 1 for SAP supplied conent */
);
Figure 2.3.2: Check the updated SAC Custom Choropleth Metadata
Figure 2.4: SAC Choropleth Visual
Figure 3.1: Dimensional Calc View
Figure 3.2: Calculated Columns
# Calculated Column Definitions
# SHAPE, ST_GEOMETRY
ST_Transform(ST_GeomFromWKT("SHAPE_WKT",4326),3857)
# SHAPEPOINT, ST_POINT
ST_Centroid("SHAPE")
# IS_LEAF, BOOLEAN
false
INSERT INTO "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY" VALUES(
'English Regions', 2, 'NAME', 'name', 7, 2, 'Local Authority', 'SHAPE', 'cv::LOCAL_AUTHORITY_DCV', '', 'COVID', '0');
Figure 3.3: sap.fpa.services.spatial.choropleth::CHOROPLETH_CUSTOM_HIERARCHY
Figure 3.4: Geo Map, Local Authority
Level | Name | Description |
1 | COUNTRY | |
2 | REGION | |
3 | SUB-REGION1 | Province, State |
4 | SUB-REGION2 | County, District |
5 | SUB-REGION3 | City, Town |
INSERT INTO "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY" VALUES(
'Country - English Regions', 3, 'AREA_NAME', 'name', 8, 1, 'Country', 'SHAPE', 'SAC_CHOROPLETH_DATA', '', 'PUBLIC', '0');
INSERT INTO "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY" VALUES(
'Country - English Regions', 3, 'AREA_NAME', 'name', 9, 2, 'Region', 'SHAPE', 'SAC_CHOROPLETH_DATA', '', 'PUBLIC', '0');
INSERT INTO "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY" VALUES(
'Country - English Regions', 3, 'NAME', 'name', 10, 3, 'English Region', 'SHAPE', 'ENGLAND_REGIONS_L1', '', 'GCOE', '0');
INSERT INTO "SAP_FPA_SPATIAL_CUSTOM_REGIONS"."sap.fpa.services.spatial::custom_hierarchy.CHOROPLETH_CUSTOM_HIERARCHY" VALUES(
'Country - English Regions', 3, 'NAME', 'name', 11, 4, 'Local Authority', 'SHAPE', 'cv::LOCAL_AUTHORITY_DCV', '', 'COVID', '0');
Figure 4.1: Data Preview of Custom Hierarchies
Figure 4.2: Select your custom hierarchy for Choropleth Drill Layer
Figure 4.3: Choropleth Hierarchy now shows four levels and the data points
Figure 4.4: Example of Choropleth drill down
Figure: 5.1 Click Save, Check Location Dimension
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
19 | |
19 | |
15 | |
9 | |
8 | |
8 | |
7 | |
6 | |
6 | |
6 |