
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Getting Started with Advanced Analytics in Qlik Sense using Python
Nov 13, 2023 3:44:39 AM
Feb 8, 2018 4:41:29 AM
This is a basic example in order to get started with Advanced Analytics Integration in Qlik Sense using PYTHON.
This customization is provided as is. Qlik Support cannot provide continued support of the solution. For assistance, reach out to our Professional Services or engage in our active Integrations forum.
The architecture at a high-level looks like this:
With this new capability, it is possible to add syntax to a chart expression that tells Qlik Sense that a particular expression should not be evaluated on the Qlik Sense server, but instead, all the information and data needed to calculate that expression should be sent via the server side extension on to the back end Python system for calculation.
After the advanced analytic calculations are completed, the data is sent back to the Qlik Sense Server and to the client for visualization.
For an example with video that uses R-Server instead, see R Integration with Qlik Sense
Resolution:
In order to display a "Hello World" message in the Qlik Sense App, Perform the steps below:
Note: To obtain the latest HelloWorld example and other Python examples, see Python Examples in Qlik's Github repository. Make sure to check out the GetStarted.md documentation as well.
- Make sure you have Python 3.4 (or later) installed including 'PIP' option. Run python -m pip install --upgrade pip to upgrade to latest version of pip.
- Install the grpcio package. In order to install it, use: python -m pip install grpcio
- Install the numpy package. In order to install it, use: python -m pip install numpy
- Install the nose package. In order to install it, use: python -m pip install nose
- Install the pandas package. In order to install it, use: python -m pip install pandas
- Install the google package. Use python -m pip install google
- Install the protobuf package. Use python -m pip install protobuf
- May need to install the google API Python package on older examples: If so, use pip install --upgrade google-api-python-client
- Note: If using Qlik Sense Desktop, add SSEPlugin=<EngineName>,localhost:<port> on a new line in your Settings.ini file located at C:\Users\[user]\Qlik\Sense. For example: SSEPlugin=SSEPython,localhost:50052
- Note: If using Qlik Sense Server, Create an Analytic Connection. See Creating an analytic connection
- Create a Qlik Sense app with basic data. In the app attached to this article Inline Load of 2 strings was used. Alternatively, use the HelloWorld example app included with the Server-Side Extension (SSE) package that can be downloaded in .zip format under Qlik SSE.
- Note: See example app attached. Create a new KPI object in a Sheet. Under Measures, add: SSEPython.ScriptAggrStr('", ".join(args[0])' , HelloWorldData)
- A Plugin using Python needs to be written so that you can communicate between Sense & Python engine using gRPC. See attached the example written using the open-source plugin provided by Qlik in order to test this functionality. Please note that these plugins are open-source and support will not be provided for it by Qlik Support (refer to the T&C in Writting an SSE Plugin
- Run the plugin in CMD prompt, using command: python ExtensionService_helloworld.py Note: Troubleshoot ModuleNotFoundError
- You will be presented with this screen
- Now restart Qlik Sense desktop & open your Sense app
- You should the below object utilizing Python:
Understanding the Python script & Function:
SSEPython.ScriptAggrStr('", ".join(args[0])' , HelloWorldData)
Eight script functions are automatically added to the functionality of the plugin. What is needed to be covered on the plugin side to fulfill
the functionality is to implement the Script aggregate rpc function.
The syntax of these functions is <EngineSSEName>.<FunctionName>(Script [,Parameter...])
where the Script is a Python script to be evaluated & Parameter is the data sent from Qlik's end.
Here, the ScriptAggrStr function is used which accepts argument of type String & returns a String after an aggregation. The 'join' function in Python method returns a string, which is the concatenation of the strings in the sequence seq. The separator between elements is the string providing this method. From Qlik side, we pass a field called HelloWorldData which contains the 2 strings as we have loaded.
To use SSE function(s) to load data via application load script, the Extension clause needs to be used. See additional information as well as an example under Load > Argument > Extension and Examples > Loading from Analytic connections via the following link: Script Regular Statements: Load.
Related Content:
- R integration with Qlik Sense
- Analytic Connections - Qlik Sense for Administrators
- Script Regular Statements - Load - Qlik Sense on Windows
- Creating an Advanced Analytics Server in 15 minutes using AWS
- Qlik Server-Side Extension (SSE) with Analytic Connections
- How to call an external / custom function in Qlik Sense?
- Qlik Sense Analytic Connection (SSE) Error when reloading App

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello,
Great article! Do you know if server-side-extension works on Qlik Cloud?
Thanks,
Elizabeth

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
I've set up an publicly available endpoint using Python which I'd like to connect to with the Advanced Analytics connector on Qlik Cloud. At the moment the endpoint is returning dummy data to test if Qlik receives everything, but I get the following error:
The following error occurred:
Connector reply error: grpc::StatusCode::FAILED_PRECONDITION: 'The response did not include the expected data table'
Am I understanding correctly that, even though the endpoint is hosted somewhere else, I basically need to follow the implementation of the code as documented in the article here?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for your answer. It seems very helpful for my need
Best Regards,
Elizabeth

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Greetings @Sonja_Bauernfeind!
I am interested in invoking inference functions written in Python, and running on Snowflake's Snowpark ML infrastructure, from a Qlik Sense SaaS App. The idea would be to achive something similar to what can be done using the Advanced Analytics Connector in a QSEoW environment, but, in the scenario that I need, the backend would be based on Snowpark ML.
Are you aware of any on-going efforts to provide this capability? Can you check with the PM in charge of Qlik Native and Custom Connectors to see if this is in the roadmap?
Cheers,
++José

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Dear
settings.ini file is empty in below folder path for qliksense desktop

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello @Tool_Tip
If the file is empty it will need to be populated with the setting you need.
All the best,
Sonja