Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlik GeoAnalytics gives us the power to perform spatial analysis within Qlik Sense and QlikView apps. While many Qlik customers have existing GIS tools, their spatial assets are quite often sitting in silos. Combining spatial data with other data through Qlik's associative engine greatly enhances the business value that can be derived from such assets.
Some BI tools can make use of local files such as KML or Esri shape files as data sources, but this introduces security and maintenance headaches. With Qlik GeoAnalytics we have the capability to consume spatial content via hosted services. This document gives a step by step guide on how we can load data from secure content in ArcGIS to Qlik Sense.
The process described here is similar for for ArcGIS Online and on-premise, but I have only tried it out with ArcGIS Online.
The integration can be broken down into these steps:
If the content is public, the process is simpler and you can skip the first two steps and ignore all the talk about tokens.
To try out these steps you will need an ArcGIS Online developer account which you can get here.
ArcGIS provides a way for applications to use secure content by using App Login. Once you register for a developer account, you'll see the option to create a new Application. Do that and you will be able to get the stuff we need to generate tokens in Qlik.
You'll need the Client ID and Client Secret to automate the process of getting new tokens in Qlik.
We can use the Qlik REST connector to obtain a token in the load script. There is a good explanation of the process on the ArcGIS side here.
For ArcGIS online we need to make a request to: https://www.arcgis.com/sharing/rest/oauth2/token/
For an on-premise server the url will look like this: https://<host>:<port>/<subdirectory>/sharing/rest/oauth2/token
Create a new REST connection in Qlik Sense with the following parameters and the Client ID and Client Secret you obtained earlier.
This will generate a load script to obtain the 'access_token'. Store the token into a variable in the load script. This can be done with the code below.
// Store the token in a variable that can be used as a request parameter
LET vToken = Peek('access_token', 0, 'root');
Tokens expire after a given period, but with this setup we can get the load script to obtain a new token before loading data from ArcGIS.
Run the load to confirm that you're able to obtain a token. Copy the token text as we'll need that to build a query. One way of doing this is to export it from a table object in Qlik Sense.
You'll need some private content on ArcGIS Online to test out this bit. Create a new layer by uploading some spatial content such as a zipped shape file.
Make sure the security is set as private.
Once the layer is created you will be able to get a Service URL.
You can validate that the layer is private by trying out this URL in your browser. You should see a 'Token Required' message.
You can add the token we obtained earlier to the URL manually using the syntax: <Service URL>?token=<token>
This lets you get to the Service Directory. From here click on the layer name, scroll all the way to the bottom and click on Query.
You now need to build a query for this layer. I've highlighted the most common parameters you might need to set for the query. Once you're done click on the Query (GET) button.
If everything goes well you should see the JSON output of the query in your browser. Copy the URL from your browser's address bar as we will use this for loading the layer in Qlik GeoAnalytics.
We can now use the URL we obtained for the query to load the layer into Qlik Sense. If you are loading a polygon layer I would recommend using the Simplify operation in the GeoAnalytics connector and excluding the original geometry field in the load. If you are loading a point layer you can use the Load operation.
Once GeoAnalytics has generated the script you can change the hard coded token with the variable using dollar sign expansion i.e. $(vToken).
You should now be able to load the secure ArcGIS content into your Qlik Sense app.
Hi @Nabeel_Asif , thank you for the response,even with Load still I have problem.the GeoJson link works in GeoData layer.(so I think It is ok)
Here are the steps which I followed:
* I tried also with link of Json and File Type=ErsiJson
and this is the error message :
In your opinion what could be a problem?
Thank you in advance.
Regards.
Matsa
@Matsa , I can't really tell. You could check if the geojson has any NULL geometries as they are a common cause of errors. You can raise a ticket with Qlik Support for help.
Hi @Nabeel_Asif ,
Is it possible to go the other way - that is, consume a Qlik endpoint in an ArcGIS Dashboard?
Thank you!
This token method works with ArcGIS services, however only if there are less than 1000 features (or whatever the limit is set at for the specific service in question). If you are the administrator of the GIS service, you can bump up the feature limit so that Qlik can consume it all at once, but if the service is managed by another organization, you don't have that option.
GeoAnalytics needs some way of handling pagination, similar to the Qlik REST connector.
There might be some way to write the Data Load script w/ Loops to handle this case, but I'm not sure...