Getting started(入门指南)¶
This guide will teach you how to authenticate to Foundry within Qlik Sense, and get started loading datasets.
Connect to Foundry¶
- You will need to have a Foundry access token ready to authenticate.
- You will also need the name of the Foundry DSN created by your server admin
- Within Qlik Sense, open the data manager, and click the icon to create a new connection
- Select
OLE DBas the data source - Choose
Microsoft OLE DB Provider for ODBC Driversas the provider - For the data source, enter
<Foundry_DSN>;PWD=<Token>, where<Foundry_DSN>is the name of the DSN your server admin created, and<Token>is your Foundry token For example, you might end up with something likeFoundry;PWD=eyJwbG50ci... - Choose
Specific user name and password, but leave them blank - Pick an appropriate name for the connection. (Qlik may have set the token in the name by default, remove this!)
- Test the connection to check everything is OK, and then click create to open the table browser.
:::callout{theme="neutral"} Qlik Sense currently has a limitation on the maximum password length you can enter into the "password" field, which is shorter than a Foundry token. This is why we set the token in the data source string rather than in the password field. :::

Loading datasets¶
After you've created a connection, a table browser will open. You can also open this browser by selecting a previously created connection. From here, you first select the Foundry project containing the dataset(s) you want to load (referred to as a "database" here).
The project tables will then be listed, and you can select the ones you wish to import.

Writing SQL queries¶
If you're familiar with SQL, you can write your own SQL queries from within Qlik Sense. This can be helpful for filtering and aggregating large datasets, so that only the smaller transformed data is imported into Qlik.
To do this, after creating a connection, open the data load editor and create a new script. Then write a SQL query like in the below image. Datasets can be referenced by their path or dataset RID, surrounded by double quotes.
For more documentation on the "LIB CONNECT" syntax, refer to the Qlik documentation.

To access a specific branch of a dataset, use the following syntax:
SELECT * FROM "branch"."dataset_path"
中文翻译¶
入门指南¶
本指南将介绍如何在 Qlik Sense 中对 Foundry 进行身份验证,并开始加载数据集。
连接到 Foundry¶
- 您需要准备好一个 Foundry 访问令牌(token)用于身份验证。
- 您还需要知道服务器管理员创建的 Foundry DSN 名称。
- 在 Qlik Sense 中,打开数据管理器,点击图标创建新连接。
- 选择
OLE DB作为数据源。 - 选择
Microsoft OLE DB Provider for ODBC Drivers作为提供程序。 - 在数据源字段中输入
<Foundry_DSN>;PWD=<Token>,其中<Foundry_DSN>是服务器管理员创建的 DSN 名称,<Token>是您的 Foundry 令牌。
例如,最终输入的内容可能类似于Foundry;PWD=eyJwbG50ci...。 - 选择
指定用户名和密码,但保持这两个字段为空。 - 为连接设置一个合适的名称。(Qlik 可能默认将令牌设置为名称的一部分,请务必删除!)
- 测试连接以确保一切正常,然后点击创建以打开表浏览器。
:::callout{theme="neutral"} Qlik Sense 目前对"密码"字段的最大密码长度有限制,该长度短于 Foundry 令牌。因此,我们将令牌设置在数据源字符串中,而非密码字段中。 :::

加载数据集¶
创建连接后,表浏览器将打开。您也可以通过选择之前创建的连接来打开此浏览器。在此界面中,首先选择包含要加载数据集的 Foundry 项目(此处称为"数据库")。
随后将列出项目中的表,您可以选择需要导入的表。

编写 SQL 查询¶
如果您熟悉 SQL,可以在 Qlik Sense 中编写自己的 SQL 查询。这对于过滤和聚合大型数据集非常有用,从而仅将较小的转换后数据导入 Qlik。
具体操作:创建连接后,打开数据加载编辑器并新建一个脚本。然后编写类似下图所示的 SQL 查询。数据集可以通过其路径或数据集 RID 引用,并用双引号括起来。
有关"LIB CONNECT"语法的更多文档,请参阅 Qlik 文档。

要访问数据集的特定分支,请使用以下语法:
SELECT * FROM "branch"."dataset_path"