Early Access: The content on this website is provided for informational purposes only in connection with pre-General Availability Qlik Products.
All content is subject to change and is provided without warranty.
Skip to main content Skip to complementary content

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 US states dissolved into regions and subregions. The maps use a drill-down dimension to create the hierarchy between region, subregion, and state.

Example map of the United States dissolved into regions

Map with dissolved regions of the USA

When you select a region, it drills down to the component subregions.

Map with a region selected, now displaying dissolved subregions

Map with a dissolved region selected, showing dissolved subregions

Selecting a subregion then displays the component states.

Map of a selected subregion, now displaying individual component states

Map with a subregion selected showing 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

  1. Add the data into Data load editor.
  2. Add the following dissolve functions:

    SubRegionAreas:

    Load * Extension GeoOperations.ScriptEval('

    Select DissolvedPolygon as SubregionPolygon, SubregionName FROM Dissolve(dissolveField="SubregionName", resolution="Source", areaDatasetKeyField="State")

    DATASOURCE subregions INTABLE keyField="State", namedAreaField="State"', Regions);

     

    RegionsAreas:

    Load * Extension GeoOperations.ScriptEval('

    Select DissolvedPolygon as RegionPolygon, RegionName FROM Dissolve(dissolveField="RegionName", resolution="Source", areaDatasetKeyField="State")

    DATASOURCE regions INTABLE keyField="State", namedAreaField="State"', Regions);

     

    Select statements must be added to rename the default fields created dissolve when there is more than one dissolve operation in the load script.

  3. Load the data.
  4. In the sheet view, create a drilldown dimension called Regions. Add the following fields to it, in order:

    • RegionName
    • SubregionName
    • State
  5. Create a drilldown dimension called RegionPolygons. Add the following fields to it, in order:

    • RegionPolygon
    • SubregionPolygon
    • State
  6. Add a map.
  7. 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.
  8. Center the region in the map and then set Limit pan navigation to Custom and click Set pan limit.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!