0% found this document useful (0 votes)
53 views27 pages

Installation Guide For Telegram Bot.V2.1 - Header

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views27 pages

Installation Guide For Telegram Bot.V2.1 - Header

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Telegram Bot for Qlik Sense

Version 2.1
Installation Guide

Abstract
Follow this guide to prepare, install and configure your own Telegram Bot. This Bot will
connect from Telegram to your Qlik Sense applications giving the users a new experience
using analytics in a conversational interface.
1
Telegram Bot for Qlik Sense 2.1 Installation guide

Contents
Preparation............................................................................................................................... 3
Qlik Sense Server .................................................................................................................. 3
Demo Kit ............................................................................................................................... 3
Troubleshooting .................................................................................................................... 3
Installation................................................................................................................................ 4
Natural Language Processing................................................................................................. 4
Microsoft LUIS ................................................................................................................... 4
Preparation ................................................................................................................... 4
Spell Check .................................................................................................................... 5
LUIS Application ............................................................................................................ 5
Google Api.Ai .................................................................................................................... 7
Natural Language Generation................................................................................................ 7
Yseop Savvy ...................................................................................................................... 7
Narrative Science .............................................................................................................. 8
News Search ......................................................................................................................... 8
Telegram Bot creation ........................................................................................................... 8
Qlik Sense server................................................................................................................... 9
What you will need ........................................................................................................... 9
Qlik Sense customization for Bots ...................................................................................... 9
Assumptions................................................................................................................ 10
Create a tag to identify all the modifications ............................................................... 10
Create Virtual Proxies .................................................................................................. 10
Streams ....................................................................................................................... 11
Apps ............................................................................................................................ 12
Bot User ...................................................................................................................... 12
Data Connection .......................................................................................................... 12
Security Rules .............................................................................................................. 13
Capture HTML ............................................................................................................. 16
Telegram Bot Software installation ..................................................................................... 17
Inline mode images ......................................................................................................... 17
Context and Authorization .............................................................................................. 17
Reports ........................................................................................................................... 18
Telegram Bot Software .................................................................................................... 18
Appendix – Troubleshooting ................................................................................................... 22

Qlik
2
Telegram Bot for Qlik Sense 2.1 Installation guide

No connection could be made because the target machine actively refused it .................... 22
SDK target system version mismatch. SDK target system version (v10.0.3) should match
server version(v3.2.0).......................................................................................................... 22
Error opening the Qlik Sense app ........................................................................................ 22
Error in QSUsers with file "...": System.IO.FileNotFoundException: Could not find file '...' .... 22
System.Xml.XmlException ................................................................................................... 23
Chart link does not appear as a link, just as plain text .......................................................... 23
Chart link appear empty or like “-----“ ................................................................................. 23
Error about licensing ........................................................................................................... 23
Error “Version string portion was too short or too long” ..................................................... 23
The chart snapshots appear empty or a white square ......................................................... 23
Appendix – How to create a new Natural Language model in other language for Google Api.Ai
............................................................................................................................................... 24

Qlik
3
Telegram Bot for Qlik Sense 2.1 Installation guide

Preparation
Qlik Sense Server
This software will be installed in a Qlik Sense server. Because the Bot will send single object
links to users to explore the Qlik Sense charts, it is recommended to use a server accessible
from the internet (public IP or DNS) to allow other users to access this charts.

Demo Kit
Unzip all the folders and files in the Telegram Bot Demo Kit.zip file to a folder in the Windows
server where Qlik Sense is running:

Troubleshooting
There is a section for solving the most common problems here: Appendix – Troubleshooting.
Please refer to this section in case of errors.

Qlik
4
Telegram Bot for Qlik Sense 2.1 Installation guide

Installation
Download the Telegram Bot Demo Kit, and unzip the files to your server hard disk. This will be
the same server where Qlik Sense Enterprise is installed.

Natural Language Processing


First we must create a NLP model to be used by the bot to understand what the users say in
their own words.

At this moment, there are two NLP engines supported, but only one is needed. Depending on
your preferences (usually based on the language you want to use for the bot), you will choose
between two options for the Natural Language Processing engine to use.

As Microsoft model has some limits in the free Azure account, I prefer to use the Google
engine, and this NLP model is more mature and is best trained because I have used it more. If
both engines are configured, only the Google model will be used.

• Microsoft LUIS:

• Google Api.Ai:
Language Language Tag
Brazilian Portuguese pt-BR
Chinese (Cantonese) zh-HK
Chinese (Simplified) zh-CN
Chinese (Traditional) zh-TW
English en
Dutch nl
French fr
German de
Italian it
Japanese ja
Korean ko
Portuguese pt
Russian ru
Spanish es
Ukrainian uk

Depending on your selection, follow the corresponding section of the next ones.

Microsoft LUIS
Preparation
• You need a Microsoft account (Hotmail or Outlook.com, for example)

Qlik
5
Telegram Bot for Qlik Sense 2.1 Installation guide

• Go to https://www.microsoft.com/cognitive-services/en-us/language-understanding-
intelligent-service-luis
• Optionally, you can get a Bing Spell Check key from here
(https://www.microsoft.com/cognitive-services/en-us/bing-spell-check-api) to be used
when creating your LUIS model, to spell check the sentences before trying to
understand them. This could help fixing typos and mistakes in voice recognition.

Spell Check
This is an optional step you could follow if you want to help the Natural Language engine to
spell check the sentences before trying to understand them. This could help fixing typos and
mistakes in voice recognition.

1. Go to https://www.microsoft.com/cognitive-services/en-us/bing-spell-check-api
2. Select “Get started for free”
3. Subscribe to the Bing Spell Check. At this moment, there is a free option for 5,000
transactions per month, 7 per minute. It should be enough for demo purposes.
4. Save the Key 1 for later (it could be used in the LUIS Application configuration).

LUIS Application
1. Go to https://www.microsoft.com/cognitive-services/en-us/language-understanding-
intelligent-service-luis
2. Login to LUIS, and go to My Applications.
3. Go to New App, and use the import option:

Qlik
6
Telegram Bot for Qlik Sense 2.1 Installation guide

4. In case you want to use the Bing Spell Check, here is where you can enter that key (Key
1):

5. Use the “Analytics General.json” file you can find in the NLP folder, and give the
application the name you like, in my case “Analytics General”:

6. Train the model. You will see this option on the bottom left corner ( ).
7. When the train is finished, publish the application ( ) to be able to call it
from the LUIS API:

8. Here, in the URL link you can obtain the LUIS App ID and the LUIS Key, that you must
save for later:

Qlik
7
Telegram Bot for Qlik Sense 2.1 Installation guide

https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/<here comes the app


id>?subscription-key=<here comes the key>&verbose=true

9. Select Update published application

Google dialogflow
You will need an account to login (Gmail, Facebook, Slack or Github).

1. Go to https://dialogflow.com/
2. Create an account, there is a “Sign up for Free” option, enough for demo purposes.
3. Go to the console (https://console.dialogflow.com) and create a new Agent. An agent
is a NL model.
4. Choose Private if you want to keep it for yourself, or Public to be available to other
people.
5. Choose English for language. If you want to create a new model for another language,
check if this already available. If not, go to Appendix – How to create a new Natural
Language model in other language for Google Api.Ai to create it.
6. Fill the required information (name, description, etc.) and save it:

7. Go to the agent configuration , in the General tab you have both keys, Client
Access Token (needed for Language Understanding, the one we need to save), and
Developer Access Token (only needed if you want to make changes from the API, not
needed for the bot).
8. Go to the Export and Import tab, select Import from Zip. When asked, use the file
AnalyticsGeneral Google.zip included in the folder NLP Models from the Demo Kit.

Natural Language Generation


This is also known by Narratives, and this process will interpret a set of data and generate
some insights in natural language. At this moment, we are using the product Savvy
(https://yseop.github.io/savvy-api/) for narratives, developed by our technology partner
Yseop.

Yseop Savvy
• Go to https://savvy.yseop.com/download/, and request an evaluation key (Select Api
Access in the Tool section).
• Save the key for later.

Qlik
8
Telegram Bot for Qlik Sense 2.1 Installation guide

Narrative Science
• You can ask for a license key to our Technology Alliances team.
• Save the key for later.

News Search
This service is used to show how Qlik Sense can integrate with another source of information
to complement the analysis.

• Go to https://www.microsoft.com/cognitive-services/en-us/bing-news-search-api, and
register a free account for the Bing News Search API (this account will expire in 90
days).
• Save the ID for later.

Telegram Bot creation


Here is where you will create the Bot in Telegram and define its properties. Think first about a
couple of things you will have to define during the process:

• Define the bot name and the userid. The userid could be anything, but it must end
with “bot” and have no spaces. For example, Qlik Sense Bot for the name and
QlikSenseBot for the userid.
• The bot profile photo, a squared photo (similar width and height), something around
250 x 250 pixel works well. Consider the copyrights for images from the internet.

You must use Telegram (from desktop, mobile and/or web), so create a Telegram account. Not
needed in the Qlik Sense server, it is just to have access from some place to configure, test and
demo.

To create the Telegram bot, follow the next steps:

1. Go to Telegram
2. In the contacts search box, look for BotFather. This is a bot to create bots.
3. Start a conversation with this bot.
4. Write /newbot, then you will be requested to write the name, for example Qlik Cool
Bot. After this, you will be requested to write the bot userid (no spaces and ending
with bot), for example QlikCoolBot.
5. If the name is not used by another bot and everything is correct, you will get a token to
access the Telegram API. Save it for later, you will have to use it in Telegram Bot
Software.
6. Write /setdescription, then you will have to select the bot first (with a button bellow
the text), and write a description text that will appear when any user starts a
conversation with the bot. For example, “This bot connects to Qlik Sense and allows
you to have an analytical conversation based on Consumer Goods Sales information”.
7. Write /setinline, then you will have to select the bot first and write the text that will
appear when the bot is called from another chat with @. For example, “Search data”.
8. Write /setinlinegeo, then you will have to select the bot first and choose Enable. This
option will allow the bot to request the user geo location from the Telegram device,
and use it to filter data in a Qlik Sense application.
9. Write /setinlinefeedback, then you will have to select the bot first and choose Disable.

Qlik
9
Telegram Bot for Qlik Sense 2.1 Installation guide

10. Write /setuserpic, then you will have to select the bot first and upload the bot profile
photo. Using the clip icon, upload the image that will appear in the bot profile.

Now, to check the bot has been successfully created, go to Telegram and using the search box
in the contacts, write the name of the bot and start a conversation with him. From now on, the
bot will appear on your recent list of contacts.

Qlik Sense server


What you will need
1. You need to have a Qlik Sense server installed (only tested with version >= 3.1).
2. Access to internet, the Bot will call different APIs on the cloud.
3. A public IP, if the bot is going to be shared with prospects and customers, for them to
be able to reach the chart links that the bot suggests to users (single object links).

An option is to use our Demo Server for these public single object links, but
you should use the same app (Consumer Goods Sales, for example) in our
Qlik Sense server (to have the same object IDs). My recommendation is to
download the app from the demo site.

To configure this option, go to the config file and review the parameters
DemoqsSingleServer (for example, to https://sense-demo.qlik.com/site)
and DemoqsSingleApp (something like 372cbc85-f7…).

Attention! If the user changes the app analyzed, the Single Object links
won’t be valid. And no self-service will be allowed.

4. A Stream for the apps available to the bot. It could be used Everyone or one specific
like Bots, or both.
5. Some demo apps published on that stream. The apps must have Master Items for
Dimensions and Measures, because the Bot will use those elements for searching what
to show the users. It is recommended to have enough charts in the app (not needed to
be master items) with titles, as those texts will be used for names when the link is sent
to users.
6. The Windows user that will run the Bot software must have read access to this stream.
a. I recommend to create a new Windows user for the Bot, for example
TelegramBot.
b. This user must have access to Qlik Sense, for example creating a User Directory
Connection for local users (Local Network).
c. This user must have a User Access allocated (do not use login access), as the
session could be running 24h a day.

Qlik Sense customization for Bots


In this section I will show a step by step Qlik Sense server customization to allow this server to
be used by Telegram users through the Bot interface.

Qlik
10
Telegram Bot for Qlik Sense 2.1 Installation guide

Assumptions
• A Qlik Sense server already installed and licensed.
• I will use http, but https can also be used.
• I will use an anonymous virtual proxy to allow Telegram users to access the apps
objects with header authentication, as this is very easy to setup, and thus making the
process simpler. This is because the primary function for this bot is demo and no
production.
• Every Bot user will need a token, unless core based licensing is used.

Create a tag to identify all the modifications


Create a Bots tag, so you can mark every object and change with this tag to find all the
modifications later if needed.

Create Virtual Proxies


Do not forget to add the load balancing node (Central by default) and link it, after created,
with a Proxy (Central by default).

Do not forget to add the IP and DNS addresses to the white list of every virtual proxy.

Anonymous access

Telegram bot users access


Create a Virtual Proxy, for Header Authentication, with the following parameters

• Description: Telegram

• Prefix: telegram

• Timeout: 30

• Session cookie header name: X-Qlik-Session-telegram

• Anonymous access mode: No anonymous user

• Authentication method: Header authentication static user directory

Qlik
11
Telegram Bot for Qlik Sense 2.1 Installation guide

• Header authentication header name: XXXXXXXXX1

• Header authentication static user directory: TELEGRAM

Streams
Bots

1
Save the "Header authentication header name" for later, as this parameter has to be used in the bot
program config file (DemoqsServerHeaderAuth). I have put it in red, but you can use whatever name
you want, for example X-Qlik-TelHeadAuth.

Qlik
12
Telegram Bot for Qlik Sense 2.1 Installation guide

Bot Publications

Apps
Now, publish all the apps that will be used in the Bot to the Bots Stream. For example,
Consumer Goods Sales Bot, Retail Margin Erosion, Executive Dashboard.

There is no need to publish anything in Bot Publications. In that Stream, only the Bot will
publish apps.

Bot User
For running the Bot software, we need to use a Windows user that will run the Bot program
and connect to Qlik Sense using Windows authentication to check the API and create the
Telegram Users. I recommend to create a new Windows local user, assign a token to it in Qlik
Sense, and grant the Content Admin role to that user.

Data Connection
If we want to demonstrate full self-service from the Bot, i.e. upload a CSV file and create a new
app from that data, we need to define a Folder Data Connection in Qlik Sense.

The Data Connections in Qlik Sense must be defined from the apps, so you should create a new
app, then create a new Folder Connection to the folder where the Bot accesses the Reports,

Qlik
13
Telegram Bot for Qlik Sense 2.1 Installation guide

and then rename it from the QMC if you like (as by default the user name is added to the data
connection name). Do not forget to add the Bots tag to this element in the QMC.

Security Rules
These security rules will allow all the Telegram users to access the Qlik Sense server through
the Anonymous virtual proxy, but only the apps in the Bots stream (and Everyone stream, that
is set by default).

Anonymous access to Bots Stream


Already created when the Bots Stream was created.

Read Access to "Bot Publications"


Already created when the “Bot Publications” Stream was created.

Anonymous users can access App Objects in Bots Stream

Qlik
14
Telegram Bot for Qlik Sense 2.1 Installation guide

Anonymous users can access Apps in Bots Stream

Modification Access to "Bot Publications"

PD.- This security rule could be easier to create from the Stream menu than from the Security
Rules menu.

Qlik
15
Telegram Bot for Qlik Sense 2.1 Installation guide

Telegram users access to "Bots" Stream

PD.- This security rule could be easier to create from the Stream menu than from the Security
Rules menu. But for the Create action, you should modify the rule after creation.

Telegram Users can access apps in Stream Bots

Qlik
16
Telegram Bot for Qlik Sense 2.1 Installation guide

Telegram Users can create apps

Telegram Users can create objects

Capture HTML
To allow the Capture HTML app being able to connect to the Qlik Sense server to render single
object images for the snapshots sent by the Bot to the users, if you use a Windows Server
version you will need to add the address used by the capture app to the intranet or trusted
sites in the Internet configuration. These addresses will be the ones set in the config file
parameters DemoqsServer, DemoqsSingleServer and cntCaptureWeb.

Qlik
17
Telegram Bot for Qlik Sense 2.1 Installation guide

Telegram Bot Software installation


Inline mode images
For the inline mode images that will be shown during an associative search, we will use the
Qlik Sense web server to access them.

And also some chart captured images to show during the alert. They will be picked randomly
from the nine available here, so you can use your own images if you like.

Copy the folder qsimg to C:\Program Files\Qlik\Sense\Client (You will need to provide
Administrator rights to write in this folder):

Context and Authorization


At this moment, we track the context for every bot user by a CSV file. This file is located at
C:\JG Bot\Context\QlikUsers.csv and will record every user that access the Telegram Bot, with
the Telegram ID and the last time he used it.

This file has one record for every user that has accessed the bot, and has the following fields:

• USERID  Telegram User ID, this is unique for every Telegram user
• USERNAME  Telegram User Name

Qlik
18
Telegram Bot for Qlik Sense 2.1 Installation guide

• QSUSERID  Qlik Sense User ID, in case we want to map a Telegram user with an
existing Qlik Sense user.
• QSUSERDIR  Qlik Sense User Directory, in case we want to map a Telegram user with
an existing Qlik Sense user.
• QSUSERNAME  Not used
• LASTACCESS  Last time the user talked to the bot
• ALLOWED  Y or N. If N, the bot will not answer this user, except with a message
saying the user is not allowed. The default value for new users can be set in the config
file.
• LANGUAGE  Not used
• EMAIL  For future use.
• ACCESSCODE  For future use.

Reports
In C:\JG Bot\Reports you can copy all the NPrinting reports you want to be available to the
users when they ask reports to the bot. Every PDF file in this folder will be shown to the user
for he to choose the one to be downloaded.

I have included some sample NPrinting reports, but you can replace or add your own reports.

The default report sent when an alert is launched can be defined in the config file.

Telegram Bot Software


By default, on the folder C:\JG Bot\Context\Bot Software, these files form the real software
program that will be running all the time, and making all the orchestration among the different
APIs.

As a first step, you will have to modify the QlikSenseBot.exe.config file with all the folders in
your server, and the APIs keys needed to run everything. This is a XML file, you can edit with a
text editor like Notepad, for example:

Follow the instructions to change every key in this file with the correct value you have from
your installation. For example, if you go to the line:

<add key = "cntBotToken" value = "Your Bot Token Here" />

You must replace the value (Your Bot Token Here) with the key value Telegram sent to your
when the Bot was created (maintaining the quotation marks). The following keys must be
configured in this config file before running the bot program:

Key Description Example


cntBotToken Token in Telegram, created by the BotFather bot during the Xxxx:d09d8a9…
process of creating the Bot
cntBotLocalAdministrator Telegram ID for the Bot Administrator. This contact will have 12345..
access to special commands from the Bot (see the User Manual).
If you do not know the ID, it can be obtained from the
QlikUsers.csv file.
cntHelpInformation Additional information that the Bot will show at the beginning of This is a cool Bot
the message, when asked for help.
cntLuisURL The URL used for the LUIS calls, obtained when creating the https://westus.api.co
model. gnitive.microsoft.co
m/luis/v2.0/apps/
cntLuisAppID Application ID from LUIS, obtained when creating the model. ebdb5- ebdb5…

Qlik
19
Telegram Bot for Qlik Sense 2.1 Installation guide

Key Description Example


If not used, please leave it empty, “”.
cntLuisKey Key for LUIS. It could be obtained from the URL generated when 64f7564f75…
publishing a LUIS model, for example:
https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/xxxxx
xxxxx?subscription-key=yyyyyyy&verbose=true, (where xxxxxxxx
is the cntLuisAppID and yyyyyyy is the cntLuisKey)
If not used, please leave it empty, “”.
cntApiAiKey Key for Google Api.Ai. If this key is filled, the Google Natural 64f7564f75…
Language will be used instead of the LUIS (from Microsoft).
If not used, please leave it empty, “”.
cntApiAiLanguage Language for the Google Api.Ai model. English
cntSavvyKey Key for Savvy Natural Language Generator, from Yseop. If this ZSDcvF…
and next fields are empty or not included, no narratives will be
generated.
cntNarrativeScienceKey Key for Narrative Science Natural Language Generator. If this and E88bc2…
previous fields are empty or not included, no narratives will be
generated.
cntBingSearchKey Key for Bing News Search. It is obtained when subscribing to this 64f7564f75…
service.
cntDefaultLanguage Default language (from the languages implemented in the Bot en-US
software). Later, any user could change the bot language with the
command language.
cntQlikUsersCSV This file will contain the list of users that have connected any C:\JG
time to the bot. It has some other information, like the last time Bot\Context\Qlik
connected. Users.csv
cntAllowNewUsers If Y, every new user that starts a conversation with the Bot will be Y or N
automatically allowed to use the bot and connect to Qlik Sense. If
N, he will receive a not allowed message.
cntAlternativeStreams Semicolon separated list of Streams where the Bot will look for Everyone;Public
other Qlik Sense applications when asked by change app
cntStreamIdPublishNewApps Stream ID where the new created apps (full self-service by 3b2fdf…
uploading a CSV) will be published. If empty, not published.
cntFolderConnection Qlik Sense folder connection name to create new apps when TelegramFiles
uploading a CSV. This connection must point to the same folder
location as the Reports (NPrintingImgsPath). Here is the
connection name, not the path.
DemoqsServer Qlik Sense server to connect. The user for the connection is the http://localhost
Windows user running the bot software.
DemoqsAppId Qlik Sense application id for the application opened by default for d44de225-68b…
every user
DemoqsAppName Alternative key to DemoqsAppId. It that one is empty, this one Consumer Goods
will be used to open the default app by name instead of by id. Sales
Please, notice various apps could have the same name, but the ID
is always unique in every Qlik Sense server  Use DemoqsAppId.
DemoqsServerSSL Yes if the connection to Qlik Sense server will be done using SSL Yes or No
(https). No in other case.
DemoqsServerVirtualProxy The Qlik Sense Virtual Proxy name used to access Qlik Sense from telegram
the Bot. I recommend to use other virtual proxy different to the
Central, to better manage the access, the authentication, etc.

Qlik
20
Telegram Bot for Qlik Sense 2.1 Installation guide

Key Description Example


DemoqsServerHeaderAuth Name of the Header authentication header name parameter, C:\JG
from the virtual proxy configuration. Bots\client.pfx
DemoqsSingleServer Qlik Sense server used to build single object links. It is https://sense-
recommended this server is a public server (public IP), to be demo.qlik.com/si
accessible from any other user. te
DemoqsSingleApp App Id for the single object link. Usually it has the same value as 372cbc85-f7…
DemoqsAppId, and only changes if using different Qlik Sense
servers for opening the app and for building the links.
cntQSSheetForAnalysis Sheet Id for the open app command from the Bot. When asked jDSPJ
for kpi, the bot will show some kpis and an option to navigate to
the app in the Hub, for self-service.
NPrintingImgsPath Folder that contains the PDF report files to be shown to the user C:\JG
when asking for reports. Bots\Reports
NPrintingDefaultReport Default report file name from the above folder to be sent when ReportSales.pdf
an alert is launched.
AlertSeconds Number of seconds when the alerts will be checked periodically. 60
Consider all the alert conditions will be true when this timer run,
to simulate what will happen in a real scenario.
LogFilePath Log files folder, if you want them in a different folder than the C:\Logs
application.
cntCaptureImageApp Capture image application path C:\JG Bots\Bot
Software\CaptureHT
ML\
CaptureHTML.exe
cntCaptureWeb Qlik Sense single object address to navigate for a chart image. http://myserver
This is in case the internal server name is different from the
external name.
cntCaptureTimeout Number of seconds to wait for a chart to render and capture. 10
cntCheckSDKVersion Option used to avoid Qlik Sense Engine for checking the SDK N
version used by the Bot software. I will avoid version mismatch
problems. It can be N or Y.

If you want to use a template for this file, here you have one based on the default settings
described in this document, where you can fill the gaps (specially the Bot token and the
qsserver name):

QlikSenseBot.exe.c
onfig

Now that everything is configured, go to the C:\JG Bot\Bot Software folder, and run the
program QlikSenseBot.exe.

Qlik
21
Telegram Bot for Qlik Sense 2.1 Installation guide

A Windows Console application will run, and every start step will be shown in the console
window. Check there are no error messages, like in the following image:

Qlik
22
Telegram Bot for Qlik Sense 2.1 Installation guide

Appendix – Troubleshooting
No connection could be made because the target machine
actively refused it
¿Have you assigned a token to the user running the bot software? ¿Does he have access to the
stream and app configured for the Bot?

Try to access the hub from this user.

¿Is HTTP enabled?

SDK target system version mismatch. SDK target system version


(v10.0.3) should match server version(v3.2.0)
If you get this error, it is caused because the Qlik Sense Engine version and the .Net SDK
version in the Bot software are not the same, and by default Qlik Sense gives an error.

We can tell Qlik Sense to avoid this version checking by setting the parameter
cntCheckSDKVersion to N, in the config file.

Error opening the Qlik Sense app


If you get an error like:

Error opening the Qlik Sense app : System.NullReferenceException: Object reference not set to
an instance of an object. at Qlik.Engine.Session.WithApp(IAppIdentifier appIdentifier, String
sessionToken) at Qlik.Engine.LocationExtensions.App(ILocation location, IAppIdentifier
appIdentifier, ISession session, Nullable`1 noVersionCheck, Boolean noData)

This could be happening because the virtual proxy the Bot is connecting to the local Qlik Sense
server is configured to allow Anonymous user. Change this setting to No anonymous user:

Error in QSUsers with file "...": System.IO.FileNotFoundException:


Could not find file '...'
The QlikUsers.csv file does not exist or the path in the config file is not correct.

Qlik
23
Telegram Bot for Qlik Sense 2.1 Installation guide

System.Xml.XmlException
And probably the program will stop working and Windows will propose to close it.

This could be due to format error in the config file. For example, you have changed something
but have delete an end symbol “>”, or not closing a string value with quotes, check the config
file has a valid XML format.

Chart link does not appear as a link, just as plain text


If you use http://localhost for the Qlik Sense server for single objects, Telegram will remove
the links to localhost (I think it is for security).

Use a link with a valid IP or name.

Chart link appear empty or like “-----“


The proposed chart has no title.

The Bot uses the Chart title, thus the recommendation is to fill titles in the app charts.

Error about licensing


Not sure yet, but it could be due to the limitation to a maximum of 5 simultaneous sessions for
one user. And as the bot software is using only one user now (until authentication is solved), it
could happen with high concurrency.

Try waiting for a couple of minutes and start the bot again, and review the licenses for the Bot
user.

Error “Version string portion was too short or too long”


First detected with June 2017 version, this error has the same origin as SDK target system
version mismatch. SDK target system version (v10.0.3) should match server version(v3.2.0). So
you should set the parameter cntCheckSDKVersion to N, in the config file.

The chart snapshots appear empty or a white square


Add the address used by the capture app to the intranet or trusted sites in the Internet
configuration. These addresses will be the ones set in the config file parameters
DemoqsServer, DemoqsSingleServer and cntCaptureWeb.

Also, be sure Enable Integrated Windows Authentication is enabled in the Internet Options, so
the user running the bot program will be able to access the single object link.

Qlik
24
Telegram Bot for Qlik Sense 2.1 Installation guide

Appendix – How to create a new Natural


Language model in other language for Google
Api.Ai
This process will create a new Natural Language model that could be configured in the bot
config file to understand sentences in other languages different from English. There are some
considerations when using another language:

• It is advisable to use a Qlik Sense app with the master items in this language, to avoid
mixing languages in the same sentence and confusing the NL engine.
• If you also want to have the bot messages translated, contact me
([email protected]) to include a resources translation for your language in the bot
software.

To create a new model with a new language, follow the instructions:

1. Create a new agent in your Google Api.Ai console (https://console.api.ai)


2. Create the Entities:
a. @Dimension
b. @Element
c. @Measure
d. Create the Intents, as defined in the following table. The sample sentences
that are shown here are in English, but they must be introduced in the new
language. The names for Intents, Actions and Parameter must be as defined in
the table (not translated).
Intent Action Parameters Examples in English (use in your language)
Apologize Apologize None I'm sorry
forgive me
BadWords BadWords None You are stupid
i hate you
ChangeLanguage ChangeLanguag None Speak in English
e talk in french
ContactQlik ContactQlik None how to contact with Qlik?
What is Qliksense?
CreateCollaboration CreateCollabora None I want to share this
Group tionGroup share this information
GoodAnswer GoodAnswer None Cool!
Great!
Help Help None Help
Demo
How can you help me?
qs-Alert Alert R Param Entity Value alert me if sales go down by 6%
Yes Measure @Measure $Measure warn me if sales increase 5%
Yes Percentage @sys.percentage $Percentage
give me a shout if sales change by 5%
qs-ClearAllFilters ClearAllFilters None Clear all filters
Remove all filters
Clear all
qs- ClearDimension R Param Entity Value Clear the filter of product
ClearDimensionFilte Filter Yes Dimension @Dimension $Dimension Remove category
r Clear family

Qlik
25
Telegram Bot for Qlik Sense 2.1 Installation guide

Intent Action Parameters Examples in English (use in your language)


qs-CreateChart CreateChart R Param Entity Value create a barchart with sales by customer for
Yes Measure @Measure $Measure milk
Yes Dimension @Dimension $Dimension I want a linechart for cost by state in florida
No Element @Element $Elemet
No ChartType @ChartType $ChartType
No Dimension @Dimension $Dimension1
qs-CurrentSelections CurrentSelections None What are the current selections
what is selected now?
What are my selections?
qs-Filter Filter R Param Entity Value Filter by Florida
Yes Element @Element $Element filter state equal Alabama
No Dimension @Dimension $Dimension
what about Florida?
No Measure @Measure $Measure
No Value @sys.number $Value
No Percentage @sys.percentage $Percentage
qs-GeoFilter GeoFilter R Param Entity Value Show me the customers within 100 kilometers
No Dimension @Dimension $Dimension Show me the customers close to me
No Distance @sys.number $Distance
No DistanceUnit @sys.unit-length- $DistanceUnit
name
qs-RankingBottom RankingBottom R Param Entity Value loss making customers
No Dimension @Dimension $Dimension show me the worst customers
No BottomNum @sys.number $BottomNum
bottom 4 customers
ber ber
qs-RankingTop RankingTop R Param Entity Value top 5 customers
No Dimension @Dimension $Dimension show me the best customers
No TopNumber @sys.number $TopNumber
qs-Reports Reports None What are the available reports
show me a report
What reports do you have
qs-ShowAllApps ShowAllApps None change the app
show me the apps
what are the applications?
qs-ShowAllDimensions ShowAllDimensions None show me the available dimensions
dimensions
Can I select a dimension?
qs-ShowAllMeasures ShowAllMeasures None Choose a measure
what are the measures?
Can I select a measure?
qs-ShowAllSheets ShowAllSheets None show me the sheets
Can I select a sheet?
qs-ShowAllStories ShowAllStories None show me the stories
Can I select a story?
qs-ShowAnalysis ShowAnalysis R Param Entity Value Show me analytics
No Dimension @Dimension $Dimension give me some analysis
No Measure @Measure $Measure
qs-ShowChart ShowChart R Param Entity Value show me the revenue by city
Yes Dimension @Dimension $Dimension show me the sales by country
Yes Measure @Measure $Measure
sales by región
qs- ShowElementsAbove R Param Entity Value how many customers with sales above
ShowElementsAboveValu Value No Dimension @Dimension $Dimension 3000?
e No Measure @Measure $Measure
Which products have margin above 15
No Percentage @sys.percentage $Percentage
No Number @sys.number $Number
%

qs- ShowElementsBelow R Param Entity Value show me the customers with sales bello
ShowElementsBelowValu Value No Dimension @Dimension $Dimension w 5%
e No Measure @Measure $Measure
Tell me which deals have margins less t
No Percentage @sys.percentage $Percentage
No Number @sys.number $Number
han 20%
qs-ShowKPIs ShowKPIs None Show me KPI
what are my kpis?
qs-ShowListOfElements ShowListOfElements R Param Entity Value list all state names
No Dimension @Dimension $Dimension Show me the list of customers with milk
No Element @Element $Element
qs-ShowMeasure ShowMeasure R Param Entity Value may I know the sales?
Yes Measure @Measure $Measure show me the expenses
let me know the margin

Qlik
26
Telegram Bot for Qlik Sense 2.1 Installation guide

Intent Action Parameters Examples in English (use in your language)


qs- ShowMeasureByMe R Param Entity Value i want sales vs margin across state
ShowMeasureByMeasure asure Yes Measure @Measure $Measure What's the performance vs budget
Yes Measure2 @Measure $Measure2
Yes Dimension @Dimension $Dimension
qs- ShowMeasureForEle R Param Entity Value show me the sales for cookie
ShowMeasureForElement ment Yes Measure @Measure $Measure give me the inventory for wine
Yes Element @Element $Element
show me the sales for tandy
qs-Hello Hello How do you do?
Hello
Hi
qs-Bye Bye Bye
Goodbye
See you

3. To train the Natural Language model (or agent), it is recommended to use quite
sentences in every intent, and review and correct the parameters identification. Try
with some sentences in the new language.
4. In the Training section, there are more possibilities to train the model. Mainly,
reviewing the history of requested sentences, and uploading a set of sentences to
review and train the model. Do this periodically, especially at the beginning.

Qlik

You might also like