How I made this: Dissolving regions and subregions
You can create custom regions using the dissolve operation. Using drill-down dimensions, you can create a hierarchical relationship between the multiple dissolved areas.
In this example, a map has been added that has USA states dissolved into regions and subregions. The maps use a drill-down dimension to create the hierarchy between region, subregion, and state.
When you select a region, it drills down to the component subregions.
Selecting a subregion then displays the component states.
Two drill-down dimensions are used to make this map. One contains the names of the regions and states. The second contains the geometry and is used as the location field.
Data
This example uses a single data set that is added inline in data load editor.
How I built this
- Add the data into Data load editor.
- Click Create new connection and select Qlik GeoOperations.
-
Click Create new connection.
-
Under Space, select the space where the connection will be located.
-
Select Qlik GeoOperations from the list of data connectors.
- Click Create.
-
Under Data connections, click on your Qlik GeoOperations connection.
-
Under Operation, select Dissolve.
-
Set the following parameters:
-
Dissolve field: SubregionName
-
Resolution: Source.
-
- Under Dataset 1, set the following parameters:
- Type: Loaded table
- Table name: Regions
- Key field: State
- Geometry type and field: Named area and State.
- Select the table and select the following fields:
- SubregionName
- DissolvedPolygon
- Click Insert script.
-
In the script, replace DissolvedPolygon with DissolvedPolygon as SubregionPolygon.
Tip noteWhen you are using multiple operations, it is important to rename default field names used by Qlik GeoOperations to avoid creating unwanted concatenations and loops in your load script.
-
Under Data connections, click on your Qlik GeoOperations connection.
-
Under Operation, select Dissolve.
-
Set the following parameters:
-
Dissolve field: RegionName
-
Resolution: Source.
-
- Under Dataset 1, set the following parameters:
- Type: Loaded table
- Table name: Regions
- Key field: State
- Geometry type and field: Named area and State.
- Select the table and select the following fields:
- RegionName
- DissolvedPolygon
- Click Insert script.
-
In the script, replace DissolvedPolygon with DissolvedPolygon as RegionPolygon.
- Load the data.
-
In the sheet view, create a drill-down dimension called Regions. Add the following fields to it, in order:
- RegionName
- SubregionName
- State
-
Create a drill-down dimension called RegionPolygons. Add the following fields to it, in order:
- RegionPolygon
- SubregionPolygon
- State
- Add a map.
-
Add an area layer using Regions as the dimension. Set the following properties:
- In Location, set the Location field to RegionPolygons.
- In Colors, set Colors to Custom and do the following:
- Select Persistent colors
- Select 100 colors.
- Set Opacity to 50%.
- Set Outline color to 000000.
- Center the region in the map and then set Limit pan navigation to Custom and click Set pan limit.