Qlik Sense

Qlik is a Business Intelligence and Analytics tool for data based decision making. Qlik allows you to make presentations, create dynamic charts and tables, and perform statistical analysis. Qlik can also be used as virtual database.

Features of Qlik:

  • With the help of direct discovery, Qlik allow users to perform Business discovery and visual analysis.

  • Mobile-ready, Roles, and Permissions.

  • Interactive dynamic apps and Dashboards.

Installation

Qlik Sense Desktop and Qlik Sense Cloud version is available for free, with Qlik account registration.

  1. To get Qlik Sense Desktop (Windows only) or Qlik Sense Cloud visit Qlik.com.

  2. Create a Qlik account.

  3. Installation link will be sent to your email.

  4. Open the email and follow the download guidelines.

  5. After download is complete, run the file and follow the installation guide.

  6. Once installation successfully completed you are ready to used your Qlik Sense application.

Examples

Below are a few examples of how to work with Qlik in combination with inmation. The examples will be based on inmation DemoData objects, to configure the demo data in your inmation environment, follow this guide.

Flat files

  1. DataStudio allows file export, right click on the selected object and choose add item(s) to History Grid. Select the desired period and History grid will be displayed on your screen.

  2. On the top left corner of the history grid use the export button to export the history data as a CSV, Excel or JSON file (Qlik supports all of these formats).

  3. The chosen file will be opened in whatever application is set as default for that file format on your system. Save the file in an accessible location.

  4. Open Qlik Sense application and click on My Computer tab. Choose the file and click on add data.

  5. You are ready to work with your data.

Web API

Postman or Swagger and inmation Web API can be used to generate the request URL, which in turn can be used to import data from inmation DataStudio to Qlik Sense. Qlik Sense supports HTTP Get and Post methods.

  1. Generate a URL using inmation Web API and Swagger or Postman applications.

  2. Open Qlik Sense application, click on the New tile, which is located on the left side of the screen. Choose REST.

  3. Paste the URL, select Get or Post method, authentication method and click Create.

  4. The data is loaded and format is automatically recognized.

If you are new to the inmation Web API, please visit the Web API documentation here.

Web - Advanced Endpoint

Advanced Endpoints are a powerful way to embed your corporate logic directly in the inmation Web API. Advanced Endpoint can be used for data export and Content-Type setting, for example to CSV instead of the usual JSON.

To create an advanced endpoint for reading historical data go to DataStudio, select the Web API Server object in the Server Model Context and click on Script Library which is located in the Object Properties panel. Add a new Script library by pressing the plus sign and name the library "my-lib". This simplified script example reads raw historical data of the process data item from the DemoData. Add this script to Lua Script Body section:

local inAPI = require('inmation.api')

local lib = {}

function lib.readhist(_, arg, req, hlp)
    arg = arg or {}
    local now = inmation.currenttime()
    local startTime
    if type(arg.starttime) == 'string' then
        -- Use starttime supplied by the caller
        startTime = arg.starttime
    else
        -- Fallback to a default relative starttime
        startTime = inmation.gettime(now-(5*60*1000))
    end
    local endTime = inmation.gettime(now)
    local qry = {
        start_time = startTime,
        end_time = endTime,
        items = {
            {
                p = "/System/Core/Examples/Demo Data/Process Data/DC4711"
            }
        }
    }

    local respData = {}
    local res = inAPI:readrawhistoricaldata(qry, req, hlp)
    local rawData = res.data or {}
    local histData = rawData.historical_data or {}
    local queryData = histData.query_data or {}
    if #queryData > 0 then
        queryData = queryData[1]
        local items = queryData.items or {}
        if #items > 0 then
            items = items[1]
            for i,t in ipairs(items.t) do
                local value = items.v[i]
                local timestampISO = inmation.gettime(t)
                local row = ("%s,%s"):format(timestampISO, value)
                table.insert(respData, row)
            end
        end
    end
    local result = table.concat(respData, '\n')
    return hlp:createResponse(result, nil, 200, { ["Content-Type"] = "text/csv" })
end

return lib

HTTP Get

Invoke the Lua script from Postman tool to test if everything is working. If your test was successful, go to your Qlik Sense application, choose New → REST, paste your URL → click ok. A preview tab should pop up, with your data transformed into data table.

Request URL
  • /api/v2/execfunction/my-lib/readhist

Response body
2019-07-23T07:39:00.041Z,16.824450683594
2019-07-23T07:39:30.041Z,16.898840332031
2019-07-23T07:40:00.041Z,17.029431152344
2019-07-23T07:40:30.041Z,17.212634277344
2019-07-23T07:41:00.041Z,17.340710449219
2019-07-23T07:41:30.041Z,17.212640380859
2019-07-23T07:42:00.041Z,17.141229248047
2019-07-23T07:42:30.041Z,17.09482421875
2019-07-23T07:43:00.041Z,17.226696777344
2019-07-23T07:43:30.041Z,17.072930908203

For more information about Advanced Endpoints visit Web API Advanced Endpoint.