Qlik Sense : Fetching data with Qlik Web Connectors

目录

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.

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

解析虚拟文件系统的调用

Linux 可以支持多达数十种不同的文件系统。它们的实现各不相同,因此 Linux 内核向用户空间提供了虚拟文件系统这个统一的接口,来对文件系统进行操作。它提供了常见的文件系统对象模型,例如 inode、directory entry、mount 等,以及…

【Linux】 reboot 命令使用

reboot 命令用于用来重新启动计算机。 语法 reboot [参数] 命令选项及作用 执行令 man --reboot 执行命令结果 参数 -n : 在重开机前不做将记忆体资料写回硬盘的动作-w : 并不会真的重开机,只是把记录写到 /var/log/wtmp 档案里-d : 不把记录写到 /var/log…

全志A40i应用笔记 | 3种常见的网卡软件问题以及排查思路

在飞凌嵌入式OKA40i-C开发板上虽然只有一个网口,但全志A40i-H处理器本身是有两个网络控制器的,因此在飞凌嵌入式提供的产品资料中提供了双网口解决方案。有的工程师小伙伴在开发过程中会遇见一些网卡的设计问题,今天小编为大家分享3种在使用O…

基于Java+SpringBoot+Mybaties-plus+Vue+ElementUI 失物招领小程序 设计与实现

一.项目介绍 失物招领小程序 用户登录、忘记密码、退出系统 发布失物 和 发布招领 查看我发布的失物和招领信息 失捡物品模块可以查看和搜索所有用户发布的信息。 二.环境需要 1.运行环境:java jdk1.8 2.ide环境:IDEA、Eclipse、Myeclipse都可以&#…

【紫光同创国产FPGA教程】【PGC1/2KG第七章】7.数字钟实验例程

本原创教程由深圳市小眼睛科技有限公司创作,版权归本公司所有,如需转载,需授权并注明出处 适用于板卡型号: 紫光同创PGC1/2KG开发平台(盘古1K/2K) 一:盘古1K/2K开发板(紫光同创PGC…

k8s configMap挂载(项目配置文件放到configMap中,不同环境不同配置)

背景说明 项目对接配置文件加密,比如数据库密码、redis密码等。但是密文只能放到指定的配置文件中(important.properties),该配置文件又不能接收环境变量,所以就很难区分不同环境的不同配置(不同环境的数据库密码、redis密码一般…

ECA-Net(Efficient Channel Attention Network)

ECA-Net(Efficient Channel Attention Network)是一种用于计算机视觉任务的注意力模型,旨在增强神经网络对图像特征的建模能力。本文详细介绍ECA-Net注意力模型的结构设计,包括其背景、动机、组成部分以及工作原理。ECA-Net模块的…

LoRaWAN物联网架构

与其他网关一样,LoRaWAN网关也需要在规定的工作频率上工作。在特定国家部署网关时,必须要遵循LoRa联盟的区域参数。不过,它是没有通用频率的,每个国家对使用非授权MHZ频段都有不同的法律规定。例如,中国的LoRaWAN频段是…

react-native 0.63 适配 Xcode 15 iOS 17.0+

iOS 17.0 Simulator(21A328)下载失败 App Store 更新到 Xcode15 后,无法运行模拟器和真机。需要下载iOS 17对应的模拟器。Xcode中更新非常容易中断失败,可以在官网单独下载iOS 17模拟器文件,例如:iOS_17.0.1_Simulator_Runtime.d…

开放智慧,助力学习——电大搜题,打开学无止境的新篇章

随着信息技术的迅猛发展,学习已经不再受时间和空间的限制。电大搜题微信公众号为广播电视大学和河南开放大学的学子们带来了便利和智慧,让学习变得更加高效和愉快。 电大搜题微信公众号作为一款专为电大学生而设计的学习助手,是学习中不可或…

红队专题-从零开始VC++C/S远程控制软件RAT-MFC-远程控制软件总结

红队专题 招募六边形战士队员[30]远控班第一期课程与远控总结 招募六边形战士队员 一起学习 代码审计、安全开发、web攻防、逆向等。。。 私信联系 [30]远控班第一期课程与远控总结 一.Bug修复(1)生成路径(2)显示系统版本号二.内存泄露(1)如何检查内存泄露 #define CRTDBG_…

【广州华锐互动】VR虚拟仿真技术为航测实践教学提供了哪些帮助?

在过去的几十年里,航空测量技术发展迅速,为我们提供了前所未有的地理信息获取手段。然而,这个领域的发展并未停止,最新的技术进步——虚拟现实(VR)——正在为航测实践教学开启新的篇章。 VR虚拟现实技术能够创建和体验三维虚拟环境…

基于SSM的二手车交易网站的设计与实现

末尾获取源码 开发语言:Java Java开发工具:JDK1.8 后端框架:SSM 前端:Vue 数据库:MySQL5.7和Navicat管理工具结合 服务器:Tomcat8.5 开发软件:IDEA / Eclipse 是否Maven项目:是 目录…

金融工作怎么做?低代码如何助力金融行业

10月30日至31日,中央金融工作会议在北京举行。金融是国民经济的“血脉”,是国家核心竞争力的重要组成部分。会议指出,党的十八大以来,在党中央集中统一领导下,金融系统有力支撑经济社会发展大局,坚决打好防…

常见React Hooks 钩子函数用法

一、useState useState()用于为函数组件引入状态(state)。纯函数不能有状态,所以把状态放在钩子里面。 import React, { useState } from react import ./Button.cssexport function UseStateWithoutFunc() {const [name, setName] useStat…

华为云分布式数据库GaussDB,做金融数字化的坚实数据底座

本篇为大家分享下GaussDB的商业进展以及产品能力升级方面的最新情况。 1. 华为云GaussDB正在从金融覆盖到更多行业 从2019年开始,在华为内部通过持续的锤炼,推出了融合多项技术的自主创新的GaussDB数据库,而且陆续完成了华为公司内部核心系统…

华为交换机端口 access、trunk和hybrid收发数据规则

文章目录 1. 三个端口类型处理数据帧的汇总表2. access 端口3. trunk端口4. Hybrid 端口(交换机的默认端口类型)5.常用命令 1. 三个端口类型处理数据帧的汇总表 端口类型收到不带VLAN标签的帧的处理规则收到带VLAN标签的帧的处理规则发送帧时的处理规则…

线性代数(二)| 行列式性质 求值 特殊行列式 加边法 归纳法等多种方法

文章目录 1. 性质1.1 重要性质梳理1.1.1 转置和初等变换1.1.2加法行列式可拆分1.1.3 乘积行列式可拆分 1.2 行列式性质的应用1.2.1 简化运算1.2.2 将行列式转换为(二)中的特殊行列式 2 特殊行列式2.1 上三角或下三角行列式2.2 三叉行列式2.3 行列式行和&…

Leetcode—125.验证回文串【简单】

2023每日刷题&#xff08;二十三&#xff09; Leetcode—125.验证回文串 实现代码 class Solution { public:bool isPalindrome(string s) {int n s.size();if(n 1 && s[0] ) {return true;}int left 0, right 0;for(right 0; right < n; right) {if(s[rig…

微服务-服务注册中心

概念 服务注册中心相当于我们例子中说的餐馆管理者&#xff0c;负责服务实例的注册、心跳、简单的负载均衡等功能&#xff0c;同一个服务的不同实例&#xff0c;在注册中心中使用同一个名称。在调用时根据名称找到具体的实例执行具体的任务。如果实例长时间没有心跳&#xff0…