Skip to main content Skip to complementary content

Tutorial – Using the OpenAI analytics connector in Qlik Cloud

This tutorial teaches you how to work with the OpenAI analytics connector to enhance your Qlik Sense apps with contextual depth from generative AI models.

You can integrate your OpenAI analytic connection directly into your data model so that data generated by it is pre-loaded into the app. Alternatively, you can use it in chart expressions. The tutorial shows you how to get set up for working with the connector, and how to create connections to the connector in Qlik Cloud. From there, it guides you through basic examples of how to incorporate the functionality into your Qlik Sense apps.

The examples in this tutorial can also be used for working with the Azure OpenAI analytics connector.

Interactive sheet showing how the OpenAI connector can be used to enhance analytics content

Interactive Qlik Sense app for using OpenAI to interact with app data. A single selection is made in the app, which triggers the OpenAI chart expression to be evaluated and provide a reponse on how to address the selected customer comment

Set up your OpenAI platform account and Qlik Cloud environment

Before you can work with the OpenAI analytics connector, you need to complete several steps. These include:

  • Create an OpenAI platform account

  • Obtain an OpenAI API key

  • Enable analytic connection functionality in Qlik Cloud

For full details, see Getting started with the OpenAI platform.

Information noteIf you are instead using the Azure OpenAI analytics connector, follow the setup provided in the Azure OpenAI connector documentation. See Creating an Azure OpenAI connection.

Create the connections

Create two connections to the OpenAI analytics connector, both using the OpenAI Chat Completions API configuration. Once you have created the connections, you are ready to start working directly with the OpenAI platform through the load script or in chart objects.

The connections will be used as follows:

Information noteIf you are instead using the Azure OpenAI analytics connector, follow the setup provided in the Azure OpenAI connector documentation. See Creating an Azure OpenAI connection.
  1. Create two new connections, one by one, to OpenAI from the Data load editor or from the Create page in the Analytics activity center. In the Data load editor, the OpenAI connector is found under Analytics sources.

  2. Select the Configuration to use. For both connections in this tutorial, use the OpenAI Chat Completions API configuration.

  3. Authenticate yourself on the connection by entering the OpenAI API key you generated in the preparations section of this tutorial.

  4. Adjust the default parameter values to suit your needs.

    Information noteYou will almost always need to alter the Max Tokens parameter value in order for the connection to function properly for your needs. This parameter controls the size of the response that will be generated.
  5. Add an Association Field to link the connection output to the data model of one or your apps:

    • For the first connection, enter RowId as the Association Field.

    • For the second connection, leave the Association Field blank.

  6. For the Name parameter, enter a distinct name value for each connection you create. You will need to use these parameter values when working in the load script or with chart expressions.

    For the purposes of the tutorial examples, use the following:

  7. Click Create.

Examples

Once you have created the connection with this configuration, you can use it in your load script and in chart expressions to communicate with OpenAI models.

These examples are designed to be stand-alone and can be completed independently of one another.

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!