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.
-
To get Qlik Sense Desktop (Windows only) or Qlik Sense Cloud visit Qlik.com.
-
Create a Qlik account.
-
Installation link will be sent to your email.
-
Open the email and follow the download guidelines.
-
After download is complete, run the file and follow the installation guide.
-
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 own environment, follow this guide.
Flat files
-
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.
-
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).
-
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.
-
Open Qlik Sense application and click on My Computer tab. Choose the file and click on add data.
-
You are ready to work with your data.
Web API
Postman or Swagger and Web API can be used to generate the request URL, which in turn can be used to import data from DataStudio to Qlik Sense. Qlik Sense supports HTTP Get and Post methods.
-
Generate a URL using the Web API and Swagger, or Postman application.
-
Open Qlik Sense application, click on the New tile, which is located on the left side of the screen. Choose REST.
-
Paste the URL, select Get or Post method, authentication method and click Create.
-
The data is loaded and format is automatically recognized.
If you are new to the 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 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 = syslib.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 = syslib.gettime(now-(5*60*1000))
end
local endTime = syslib.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 = syslib.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.
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 the Web API Advanced Endpoints page.