Skip to main content

Migrating from GeoAnalytics Connector to Qlik GeoOperations

Qlik GeoOperations in Qlik Cloud provides similar features and operations as the GeoAnalytics Connector does within Qlik Sense Enterprise on Windows. They also support many of the same data formats. They have the following differences:

  • Qlik GeoOperations is an Advanced Analytics Integration (AAI), which is more suitable for sending out and processing data than a connector.

  • Script syntax is different for Advanced Analytics Integrations than for connectors.

  • Some GeoOperations can also be used in chart expressions.

  • Qlik GeoOperations returns a single table. Compared to what the GeoAnalytics Connector returns, the tables are joined in Qlik GeoOperations.

  • In Qlik GeoOperations, some fields and parameters has been renamed to be more consistent.

The following outlines how to convert the script produced by the GeoAnalytics Connector Wizard to Qlik GeoOperations:

  1. In Data load editor, in the GeoAnalytics Connector script code, copy everything after SQL up to the second SELECT or ";", whichever comes first.
  2. Replace all ' in the GeoAnalytics Connector script with ".
  3. Add the selected field names from the secondary SELECT statement in the GeoAnalytics Connector script to the first SELECT statement in the GeoOperations script. Omit any fields that are already there. Add the source table name to the field names, separating them with a period. For example, table.field. This will create a single joined table instead of several tables.

  4. Review the reference documentation for the operation and dataset and adjust any parameter or field names where needed.

    Operation

    Dataset

    For a summary of key differences, see GeoOperations and GeoAnalytics field differences

  5. Add the following to the start of the GeoOperations script: 

    Load * Extension GeoOperations.ScriptEval('

  6. Add the following to the end of the GeoOperations script:

    ');

If using a loaded table with the GeoAnalytics Connector, send it as the second parameter to GeoOperations.ScriptEval instead.

As Qlik GeoOperations returns a joined table, only field values that have a corresponding value in the primary table are returned from the secondary tables. For example, if you want to find the closest airports in Germany for some points, only data about airports that are closest to the points are returned. If you want all airports in Germany, they need to be loaded separately with a LOAD operation.

If loading from an SQL database with the connector, the data should instead be loaded with one of the database connectors like the ODBC connector. Make sure to load the geometries as WKT (apply a function usually called st_asText() in the SQL query). Then convert the WKT field by sending the table to Qlik GeoOperations. It will then return a field with the geometries in Qlik Sense format.

Example script conversion

This script conversion example will use the following GeoAnalytics Connector script:

/* Generated by GeoAnalytics for operation Cluster ---------------------- */ [ClusterAssociations]: SQL SELECT [LocationDbId], [Clusters_ClusterID] FROM Cluster(distance='10000', points='Points') DATASOURCE Points LOCATIONSERVICE geometry='POINT', type='XIATA', country='de', serviceName='default' SELECT [Clusters_ClusterID], [Clusters_ClusterCenter] FROM Clusters; [Clusters]: SQL LOAD * FROM Clusters; tag field [LocationDbId] with '$primarykey'; tag field [Clusters_ClusterID] with '$primarykey'; tag field [Clusters_ClusterCenter] with '$geopoint'; tag field [Clusters_ClusterID] with '$geoname'; tag field [Clusters_ClusterCenter] with '$relates_Clusters_ClusterID'; tag field [Clusters_ClusterID] with '$relates_Clusters_ClusterCenter'; /* End GeoAnalytics operation Cluster ----------------------------------- */

Do the following:

  1. Take the script between SQL and the second SELECT statement.

    SELECT [LocationDbId], [Clusters_ClusterID] FROM Cluster(distance='10000', points='Points') DATASOURCE Points LOCATIONSERVICE geometry='POINT', type='XIATA', country='de', serviceName='default'
  2. Replace quotes:

    SELECT [LocationDbId], [Clusters_ClusterID] FROM Cluster(distance="10000", points="Points") DATASOURCE Points LOCATIONSERVICE geometry="POINT", type="XIATA", country="de", serviceName="default"
  3. Add fields from secondary tables:

    SELECT [LocationDbId], [Clusters_ClusterID], [Clusters.Clusters_ClusterCenter] FROM Cluster(distance="10000", points="Points") DATASOURCE Points LOCATIONSERVICE geometry="POINT", type="XIATA", country="de", serviceName="default"
  4. Adjust parameter and field names:

    SELECT [LocationDbId], [ClusterID], [Clusters.ClusterPoint] as [Clusters_ClusterCenter] FROM Cluster(distance="10000", points="Points") DATASOURCE Points LOCATIONSERVICE geometry="POINT", type="XIATA", country="de", serviceName="default"
  5. Enclose in boilerplate code:

    Load * Extension GeoOperations.ScriptEval(' SELECT [LocationDbId], [ClusterID], [Clusters.ClusterPoint] as [Clusters_ClusterCenter] FROM Cluster(distance="10000", points="Points") DATASOURCE Points LOCATIONSERVICE geometry="POINT", type="XIATA", country="de", serviceName="default" ');

This script code now can be used with Qlik GeoOperations.

GeoOperations and GeoAnalytics field differences

The default fields between GeoOperations and GeoAnalytics scripts have differences, typically with prefixes. When migrating your GeoAnalytics scripts to GeoOperations, you might need to adjust some of the field names.

AddressToPoint

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, Address, AddressPoint, CountryIso2, Adm1, City, PostalCode, Street, HouseNumber, Match

  • GeoAnalytics: [<id>], [Dataset_Address], [Dataset_Geometry], [CountryIso2], [Dataset_Adm1], [Dataset_City], [Dataset_PostalCode], [Dataset_Street], [Dataset_HouseNumber], [Dataset_Match]

GeoAnalytics and GeoOperations have the following differences:

  • GeoAnalytics fields have prefixes from the dataset.

  • Dataset_Geometry is called AddressPoint in GeoOperations.

Binning

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, BinId, BinTable.BinPolygon, BinTable.CenterPoint

  • GeoAnalytics: [<id>], [RH2W3], [RH2W3_CenterPoint]

GeoAnalytics and GeoOperations have the following differences:

  • In GeoAnalytics, RH2W3 is the polygon field and its name is generated based on grid size / ratio. In GeoOperations the field is BinTable.BinPolygon.

  • GeoAnalytics does not have a BinId field.

Closest

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: dataset_dataset2_RelationId, dataset.<ds1 id>, dataset2.<ds2 id>, Distance

  • GeoAnalytics: [Dataset1_Dataset2_RelationId], [Dataset1.<ds1 id>], [Dataset2.<ds2 id>], [Dataset1_Dataset2_Distance]

GeoAnalytics and GeoOperations have the following differences:

  • GeoOperations has no prefixes for the Distance field.

Cluster

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, ClusterID, Clusters.ClusterPoint, Clusters.PointCount

  • GeoAnalytics: [<id>], [Clusters_ClusterID], [Clusters_ClusterCenter], [Clusters_PointCount]

GeoAnalytics and GeoOperations have the following differences:

  • Prefixes are different between GeoOperations and GeoAnalytics.

Dissolve

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, DissolvedPolygon

  • GeoAnalytics: [<id>], [<id>_Geometry]

GeoAnalytics and GeoOperations have the following differences:

  • Name of the geometry column

Intersects

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: dataset_dataset2_RelationId, dataset.<dataset1 id>, dataset2.<dataset2 id>, dataset.RelativeOverlap, dataset2.RelativeOverlap

  • GeoAnalytics: [Dataset1_Dataset2_RelationKey], [Dataset1.<ds1 id>], [Dataset2.<ds1 id>], [Dataset1_RelativeOverlap], [Dataset2_RelativeOverlap]

GeoAnalytics and GeoOperations have the following key differences:

  • Prefixes between GeoOperations and GeoAnalytics differ.

IpLookup

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, IpPoint, CountryIso2, Adm1Code, City

  • GeoAnalytics: [<id>], [IpTable_Geometry], [CountryIso2], [IpTable_Adm1Code], [IpTable_City]

GeoAnalytics and GeoOperations have the following differences:

  • IpTable_Geometry in GeoAnalytics is IpPoint in GeoOperations.

  • Prefixes between GeoOperations and GeoAnalytics differ.

Load (location dataset)

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations (area): LocationDbId, LocationPolygon, Name, CountryIso2, Adm1Code, Adm2Code, LocationDbType

  • GeoOperations (point): LocationDbId, LocationPoint, Name, CountryIso2, Adm1Code, Adm2Code, LocationDbType

  • GeoAnalytics: [LocationDbId], [Dataset_Geometry], [Dataset_Name], [CountryIso2], [Dataset_Adm1Code], [Dataset_Adm2Code], [LocationDbType]

GeoAnalytics and GeoOperations have the following differences:

  • The geometry fields (LocationPolygon and LocationPoint in GeoAnalytics are Dataset_Geometry in GeoOperations.

  • Prefixes between GeoOperations and GeoAnalytics differ.

PointToAddress

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, Address, AddressPoint, CountryIso2, Adm1, City, PostalCode, Street, HouseNumber, Distance

  • GeoAnalytics: [<id>], [Dataset_Address], [Dataset_Geometry], [CountryIso2], [Dataset_Adm1], [Dataset_City], [Dataset_PostalCode], [Dataset_Street], [Dataset_HouseNumber], [Dataset_Distance]

GeoAnalytics and GeoOperations have the following differences:

  • Prefixes between GeoOperations and GeoAnalytics differ.

Routes

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, Distance, Duration, Status, LowResLine

  • GeoAnalytics: [<id>], [Dataset_Distance], [Dataset_Duration], [Dataset_Status], [Dataset_PathLowRes]

GeoAnalytics and GeoOperations have the following differences:

  • The geometry field Dataset_PathLowRes in GeoAnalytics is LowResLine in GeoOperations.

  • Prefixes between GeoOperations and GeoAnalytics differ.

Simplify

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, Simplified_<geo field name>

  • GeoAnalytics: [<id>], [Dataset_Simplified_Geometry]

.GeoAnalytics and GeoOperations have the following differences:

  • The names of the geometry field are different between GeoOperations and GeoAnalytics.

TravelAreas

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: <id>, TravelArea, Cost, CostUnit, Status

  • GeoAnalytics: [<id>], [Dataset_TravelArea], [Dataset_Origin], [Dataset_Cost], [Dataset_CostUnit], [Dataset_Status]

GeoAnalytics and GeoOperations have the following differences:

  • GeoOperations does not include an origin field.

  • Prefixes between GeoOperations and GeoAnalytics differ.

Within

GeoOperations and GeoAnalytics return the following fields:

  • GeoOperations: dataset_dataset2_RelationId, dataset.<dataset1 id>, dataset2.<dataset2 id>

  • GeoAnalytics: [Enclosed_Enclosing_RelationId], [Enclosed.<dataset 1/2 id>], [Enclosing.<datasets 1/2 id>]

GeoAnalytics and GeoOperations have the following differences:

  • GeoOperations prefixes include dataset names, while GeoAnalytics also includes the prefix Enclosed.

Visit the discussion forum at community.qlik.com

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 – please let us know!