Qlik Sense : Fetching data with Qlik Web Connectors

news2024/11/24 8:57:07

目录

Connecting to data sources

Opening a connector

Connecting to a data source

Authenticating the connector

Defining table parameters

Using standard mode or legacy mode

Standard mode

Connector overview

Using multi-line input parameters to fetch data

Making data request with synchronous, asynchronous, batch, and auto mode

Writing requests

Synchronous requests

Asynchronous requests

Specifying the number of threads

Batch requests

Auto requests

Using URLs instead of file paths

Special parameters


Connecting to data sources

The Qlik Web Connectors let you connect to many web-based data sources from a single web-service. The way you connect to a data source and interact with the Qlik Web Connectors is mostly the same regardless of the data source. This page describes how to open a data source connection and how you select data.

Opening a connector

To open a data source connector, select the Connectors tab.

Connecting to a data source

Tip noteIn this example, we connect to Twitter but the steps are similar for all data source connectors.

Authenticating the connector

Do the following:

  1. Click on the Qlik Twitter Connector.
  2. Under Select Tables, select CanAuthenticate.

    Tip noteClick the Authenticate button to open the data source login page in a new window. Make sure your browser is not blocking pop-up windows for Qlik Web Connectors.

  3. Enter your account login credentials.

  4. Copy the authentication code and paste it into the CanAuthenticate table.
  5. Click Save.

You only have to authenticate the connector once. After you do this, you can run any of the tables for the data source that you logged into. You can also authenticate the connector from any of the other tables.

Defining table parameters

Each connector table is used to select different types of data from your data source. Before the connector can send a request, you need to define some table parameters. Parameters that are required are marked with an asterisk (*).

In this example, we use the Twitter Search Query table to retrieve tweets in English that contain the word Qlik.

Do the following:

  1. Select Search (simple) from the list of tables.
  2. In the Search Query box, enter Qlik.
  3. In the Language box, enter en for English.

    Search Query entry with EN specified for Language

  4. Click Save Inputs & Run Table.

    The Twitter connector makes a request to get all Tweets in English that contain the search term Qlik.

    As the table search is running, you will see its progress bar along the bottom, with a Cancel button if you need to abort. The Data Preview tab, shows a preview of the data so that you can check if the data as expected.

  5. Click on the QlikView, Qlik Sense (Standard Mode), or Qlik Sense (Legacy Mode) tabs to view the relevant script to copy into your QlikView or Qlik Sense application.
  6. Click on Copy to clipboard to copy the script.
  7. Paste the script into your application.

When reloading in QlikView or Qlik Sense, the load script makes the same request to Qlik Web Connectors, which contacts the relevant platform to get the data and stream it into your application.

Using standard mode or legacy mode

Depending on the Qlik Web Connectors and Qlik Sense version you are using, you might need to put Qlik Sense in legacy mode. To do this you have to disable standard mode, which prevents Qlik Sense from creating or running requests from arbitrary URLs. If you have problems running your script in Qlik Sense try disabling standard mode. To learn how to disable standard mode see Disabling standard mode.

Information noteIt is recommended to use the Qlik Web Connectors with Qlik Sense in standard mode.

Standard mode

You can only use the script from Qlik Sense (Standard Mode) tab in your Qlik Sense application if you are using Qlik Sense February 2018 or later.

Do the following:

  1. In Qlik Sense, Create new connection and choose Web file from the list of data sources.
  2. Use the URL to your Qlik Web Connectors installation and give the connection a name.
  3. Place the following line at the top of your script:

    let vQwcConnectionName = 'lib://YOUR_CONNECTION_NAME';

  4. Replace YOUR_CONNECTION_NAME with the name that you gave to the connection.

Connector overview

Each connector has a number of other tabs:

  • Support - Links to the Qlik Help page.
  • Settings - Displays the cached data and reset settings option.
  • Change Log - Shows the history of changes that have been made to the specific connector
  • About - Contains information about version, permissions, and links to other documentation sources.

Using multi-line input parameters to fetch data

Some connector tables let you enter multi-line input parameters for setting, for example, JSON or XML configuration or other input data for a connector. A commonly used example of this is the POST/PATCH/PUT Parameter(s) on the Qlik General Web Connector.

POST PATCH PUT Parameters in JSON To XML Raw interface

You can type your multi-line parameters directly into the field or you attach a file by specifying the file path.

Example:  

@file=c:\path\to\file.txt

A file can be used in conjunction with the ReplaceTokensInFile table in the Qlik Helper Connector.You can have a version of the file that contains placeholder tokens, and then use the ReplaceTokensInFile table to replace these tokens before passing them as a multi-line input parameter to one of the connector tables.

Making data request with synchronous, asynchronous, batch, and auto mode

You can make the following request types with Qlik Web Connectors:

  • Synchronous
  • Asynchronous
  • Batch
  • Auto

Writing requests

For/next loops are often used to run a large number of API requests with Qlik Web Connectors. These modes let you extract the maximum performance from Qlik Web Connectors and minimize load time of the QlikView or Qlik Sense application.

For example, if you run a large number of text messages through one of the available sentiment analysis connectors, like Sentiment140, it can result in a long load time.

Example:  

LET noRows = NoOfRows('Tweets');   for i=0 to $(noRows)-1   let id = peek('Search_id', $(i), 'Tweets'); let textEncoded = peek('text_urlEncoded', $(i), 'Tweets');   Sentiment: LOAD '$(id)' as Search_id, status as sentiment_status, score as sentiment_score FROM [http://localhost:5555/web/connector/TextAnalyserV2/?table=Sentiment_Sentiment140&text=$(textEncoded)&appID=$(vQWCAppId)format=qvx] (qvx); next

In the script example above, each message is processed sequentially. This means that the sentiment score for the next message cannot be calculated until the current request has completed. If each request takes 250 ms, then it will take 40 minutes to score the sentiment score of 10,000 Tweets.

Many APIs allow multiple requests to be made in parallel from the same client so we can use different request types to improve the performance of the Qlik Web Connectors.

These requests are handled by separate processes on the server or cloud, allowing more requests to be processed per second. The Asynchronous mode allows us to take advantage of this feature.

Some APIs also allow multiple requests to be combined into a single API call, for example sending 1000 text messages in a single request to be processed for sentiment. This is referred to as sending requests in a batch and it is the Batch mode that allows us to take advantage of this feature.

Synchronous requests

Synchronous requests are the default mechanism and all tables of all connectors support this. A request to Qlik Web Connectors results in one or more sequential requests to the underlying API and this is the script you receive when copying the standard generated script from Qlik Web Connectors.

For simple for/next loops, It is possible to simplify the script by using a temporary table.

Example: For/next loop

LET noRows = NoOfRows('Tweets');   for i=0 to $(noRows)-1   let id = peek('Search_id', $(i), 'Tweets'); let textEncoded = peek('text_urlEncoded', $(i), 'Tweets');   Sentiment: LOAD '$(id)' as Search_id, status as sentiment_status, score as sentiment_score FROM [http://localhost:5555/web/connector/TextAnalyserV2/?table=Sentiment_Sentiment140&text=$(textEncoded)&appID=$(vQVSourceAppId)format=qvx] (qvx); next

Example: Temporary Params table

let vQWCAppId = 'test_app'; let vWorkingFolder = 'c:\QlikWebConnectors\Temp\'; let vParamsFile = '$(vWorkingFolder)$(vQWCAppId)' & '_SentimentArgs.txt';   Params: LOAD Search_id as rowKey, Search_text as text resident Tweets;   store Params into '$(vParamsFile)' (txt); drop table Params; // Optional.   Sentiment: LOAD rowKey as Search_id, status as Sentiment_status, score as Sentiment_score, language as Sentiment_language FROM [http://localhost:5555/web/connector/TextAnalyserV2/?table=Sentiment_Sentiment140& processParamsSync=$(vParamsFile)&appID=$(vQWCAppId)&format=qvx] (qvx);

Create a temporary table named Params that contains the same parameters that are passed in each iteration of the for/next loop above.

There are several important changes to the new script:

  • An additional column named rowKey, which is set to the Tweet ID, so we can link it back into the data model when the results come back.
  • The Params table is saved as a CSV file. It is important that the user account that is running the Qlik Web Connectors has read access to this file.

Information noteThe parameters in the Params table should not be URL encoded.

Warning noteThere are certain parameters you cannot put in the Params table. In particular, the table or format parameters cannot be used. These should be in the final Qlik Web Connectors request. For a complete list of parameters, see Special parameters

The script makes a request to Qlik Web Connectors but instead of passing the usual parameters, it passes the path of the previously created CSV file using the processParamsSync parameter. We also read back the rowKey and alias ID back to the Tweet ID.

You can apply this method to almost any Qlik Web Connectors request, and it is the basis of the Asynchronous, Batch and Auto modes.

Information noteYou can use rowKey2 and rowKey3 parameters with processParamsSync.

Asynchronous requests

To make asynchronous requests, you simply change the parameter name processParamsSync into processParamsAsync:

Sentiment: LOAD rowKey as Search_id, status as Sentiment_status, score as Sentiment_score, language as Sentiment_language FROM [http://localhost:5555/web/connector/TextAnalyserV2/?table=Sentiment_Sentiment140& processParamsAsync=$(vParamsFile)&appID=$(vQWCAppId)&format=qvx] (qvx);

Qlik Web Connectors attempts to run the requests on a number of parallel threads and the above call only completes when all the requests have finished.

Information noteYou can use rowKey2 and rowKey3 parameters with processParamsAsynch.

Specifying the number of threads

By default, Qlik Web Connectors use a maximum of 30 parallel threads.

You can set an alternative value, between 1 and 50, by including a maxThreads=VALUE parameter in the request.

Batch requests

To make batch requests, you simply change the parameter name processParamsSync into processParamsBatch:

Sentiment: LOAD rowKey as Search_id, status as Sentiment_status, score as Sentiment_score, language as Sentiment_language FROM [http://localhost:5555/web/connector/TextAnalyserV2/?table=Sentiment_Sentiment140& processParamsBatch=$(vParamsFile)&appID=$(vQWCAppId)&format=qvx] (qvx);

Qlik Web Connectors attempt to run the requests using the Batch feature that the API provides, and the above call only completes when all the requests have finished.

Information noteYou can use rowKey2 and rowKey3 parameters with processParamsBatch.

Auto requests

If you want Qlik Web Connectors to decide the best method, you can change the parameter name processParamsSync into processParamsAuto:

Sentiment: LOAD rowKey as Search_id, status as Sentiment_status, score as Sentiment_score, language as Sentiment_language FROM [http://localhost:5555/web/connector/TextAnalyserV2/?table=Sentiment_Sentiment140& processParamsAuto=$(vParamsFile)&appID=$(vQWCAppId)&format=qvx] (qvx);

When you use auto requests, Qlik Web Connectors uses the following rules:

  • If the table supports batch mode, Qlik Web Connectors uses this method.
  • If the table explicitly supports asynchronous mode, Qlik Web Connectors uses this method.
  • Otherwise, Qlik Web Connectors uses the standard synchronous mode.

Information noteYou can use rowKey2 and rowKey3 parameters with processParamsAuto.

Information noteAuto request mode is not recommended because only a few connectors explicitly support asynchronous mode, so Qlik Web Connectors would fall back on the slowest synchronous mode. We recommended that you look at each table you are using and decide whether to use synchronous, asynchronous or batch mode.

Using URLs instead of file paths

When using a processParamsxxx parameter, as well as passing a file location to it, you can also pass a URL beginning with http or https.

Special parameters

Certain parameters can be used by any Qlik Web Connectors connector. These parameters should not be placed in the Params CSV file but specified in the request URL for the table.

Parameters available to be used
ParameterDescription
tableThe name of the table requested. Should only be included in the final request.
formatTells Qlik Web Connectors what format to return the data in. As all the data for a given request must be returned in the same format this cannot appear in the Params file. In almost all cases this should be set to qvx.
appIDAn identifier for your application passed to Qlik Web Connectors allowing it to be logged alongside any errors which may occur.
requestStampAllows you to specify an id for a request which you can then use to access follow on data from another table related to the request.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1185750.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

提前尝鲜!铁威马TOS 6内测招募中,赢取“遥遥领先”!

铁威马NAS的出现为我们解决了绝大部分的数据存储难题,而作为国民专业级NAS的铁威马,也从未停止前进的脚步,不断的升级和改造,致力于为用户打造一个更友好更安全的存储环境。 铁威马全新操作系统TOS 6来了!40多项新功能…

制药企业如何提高员工的GMP合规意识

在上期的文章中,我们介绍了>>制药企业计算机化系统验证(CSV)的重要性,本期我们深入探讨制药企业如何培养员工形成GMP良好的合规意识。 良好的药品质量是保障患者安全和有效治疗的基石。为了确保药品的质量、安全性和一致性,制药企业必…

美国财政部制裁俄罗斯洗钱人士打击网络犯罪

导语 美国财政部近日对一名37岁的俄罗斯女子实施了制裁,原因是她参与了为俄罗斯精英和网络犯罪团伙洗钱的行为。这一行动旨在打击网络犯罪活动,保护国际金融市场的安全。本文将详细介绍制裁对象以及网络犯罪的持续演变。 制裁俄罗斯洗钱人士 根据美国财政…

20231108在Ubuntu22.04下编译安装cmake-3.27.7.tar.gz

20231108在Ubuntu22.04下编译安装cmake-3.27.7.tar.gz 2023/11/8 17:28 缘起,编译cv180zb的时候提示说cmake的版本低! OBJCOPY platform/generic/firmware/payloads/test.bin OBJCOPY platform/generic/firmware/fw_dynamic.bin OBJCOPY platfor…

【AntDesign】Docker部署

docker部署是主流的部署方式,极大的方便了开发部署环境,保持了环境的统一,也是实现自动化部署的前提。 1 项目的目录结构 dist: 使用build打包命令,生成的打包目录 npm run build : 打包项目命令 docker: 存放docker容器需要修改…

2023年11月IDE流行度最新排名

点击查看最新IDE流行度最新排名(每月更新) 2023年11月IDE流行度最新排名 顶级IDE排名是通过分析在谷歌上搜索IDE下载页面的频率而创建的 一个IDE被搜索的次数越多,这个IDE就被认为越受欢迎。原始数据来自谷歌Trends 如果您相信集体智慧&am…

串口中断(10)自定义通讯协议-协议带数据长度及接收应答处理

本文为博主 日月同辉,与我共生,csdn原创首发。希望看完后能对你有所帮助,不足之处请指正!一起交流学习,共同进步! > 发布人:日月同辉,与我共生_单片机-CSDN博客 > 欢迎你为独创博主日月同…

2023年11月数据库流行度最新排名

点击查看最新数据库流行度最新排名(每月更新) 2023年11月数据库流行度最新排名 TOP DB顶级数据库索引是通过分析在谷歌上搜索数据库名称的频率来创建的 一个数据库被搜索的次数越多,这个数据库就被认为越受欢迎。这是一个领先指标。原始数…

微信小程序登录后端

一、 概念 code code是用户登录凭证,个人理解为用户的授权码(需要用户本人授权给小程序,小程序才有权力获取到你这个用户的数据),code需要由小程序向微信服务器获取。 注意: 每个code只能使用一次,且有效…

射频功率放大器应用中GaN HEMT的表面电势模型

标题:A surface-potential based model for GaN HEMTs in RF power amplifier applications 来源:IEEE IEDM 2010 本文中的任何第一人称都为论文的直译 摘要:我们提出了第一个基于表面电位的射频GaN HEMTs紧凑模型,并将我们的工…

kubernetes集群编排——k8s认证授权

pod绑定sa [rootk8s2 ~]# kubectl create sa admin [rootk8s2 secret]# vim pod5.yaml apiVersion: v1 kind: Pod metadata:name: mypod spec:serviceAccountName: admincontainers:- name: nginximage: nginxkubectl apply -f pod5.yamlkubectl get pod -o yaml 认证 [rootk8s…

SpringBoot案例学习(黑马程序员day10,day11)

1 环境准备&#xff1a; 1.idea 创建spring项目&#xff0c;选择springweb,mybatis framework ,sql drive框架 2.添加pom.xml依赖&#xff1a; <dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId></dependen…

关于 pthread_create 传参的疑问

对于函数原型 int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg) 里的参数 arg&#xff0c;之前一直有疑问&#xff0c;就是把 &thread 传给 arg时&#xff0c;新创建的线程里是否能取到这个值呢&#xff1…

小程序多文件上传 Tdesign

众所周知&#xff0c;小程序文件上传还是有点麻烦的&#xff0c;其实主要还是小程序对的接口有诸多的不便&#xff0c;比如说&#xff0c;文件不能批量提交&#xff0c;只能一个个的提交&#xff0c;小程序的上传需要专门的接口。 普通的小程序的页面也比普通的HTML复杂很多 现…

SQL SERVER Inregration Services-OLE DB、Oracle和ODBC操作

OLE DB链接器 OLE DB插件下载&#xff1a;https://learn.microsoft.com/zh-cn/sql/connect/oledb/download-oledb-driver-for-sql-server?viewsql-server-ver16 配置OLE DB Connection Manager 在点击“新建”时&#xff0c;会弹出警告信息“不支持指定的提供程序&#xff0…

SpringBoot系列之集成Redission入门与实践教程

Redisson是一款基于java开发的开源项目&#xff0c;提供了很多企业级实践&#xff0c;比如分布式锁、消息队列、异步执行等功能。本文基于Springboot2版本集成redisson-spring-boot-starter实现redisson的基本应用 软件环境&#xff1a; JDK 1.8 SpringBoot 2.2.1 Maven 3.2…

k8s 目录和文件挂载到宿主机

k8s生产中常用的volumes挂载方式有&#xff1a;hostPath、pv&#xff0c;pvc、nfs 1.hostPath挂载 hostPath是将主机节点文件系统上的文件或目录挂载到Pod 中&#xff0c;同时pod中的目录或者文件也会实时存在宿主机上&#xff0c;如果pod删除&#xff0c;hostpath中的文…

CANoe测试报告如何打印表格?

文章目录 效果使用函数TestInfoTableTestInfoHeadingBeginTestInfoCellTestInfoHeadingEndTestInfoRow代码效果 使用函数 以下函数使用方法查看帮助文档。 TestInfoTable TestInfoHeadingBegin TestInfoCell TestInfoHeadingEnd TestInfoRow 代码

css设置浏览器表单自动填充时的背景

浏览器自动填充表单内容&#xff0c;会自动设置背景色。对于一般的用户&#xff0c;也许不会觉得有什么&#xff0c;但对于要求比较严格的用户&#xff0c;就会“指手画脚”。这里&#xff0c;我们通过css属性来设置浏览器填充背景的过渡时间&#xff0c;使用户看不到过渡后的背…

Python之字符串、正则表达式练习

目录 1、输出随机字符串2、货币的转换&#xff08;字符串 crr107&#xff09;3、凯撒加密&#xff08;book 实验 19&#xff09;4、字符替换5、检测字母或数字6、纠正字母7、输出英文中所有长度为3个字母的单词 1、输出随机字符串 编写程序&#xff0c;输出由英文字母大小写或…