【问题标题】:QlikSense help - Star Schema/Joins or ApplyMapQlikSense 帮助 - Star Schema/Joins 或 ApplyMap
【发布时间】:2021-11-14 19:18:19
【问题描述】:

我是 QLIK、脚本和整体初学者的新用户。我正在寻找任何帮助或建议来处理下面的表格。只是想创建一个好的模型来链接我的表。

在这里创建了一个示例 file原来3个表是不同的qvd文件

  1. Transactions 表有多个列,主要有 TxnID、SourcePartyTypeID、DestPartyTypeID、SourcePartyType、DestinationPartyType、ConductorID。
  2. 客户表 - 客户名称、客户 ID 等。
  3. 帐户表 - AcctID、AcctNum、PrimaryActID 等。

对于事务,它可以与由 Dest/SourcePartyID 链接的多个 CustID/AcctID 相关联。该交易还有一个源/目标方类型字段,其中 A = 帐户,C = 客户和一些 NULL。

我已经阅读了很多关于数据模型的内容,建议使用星型模式或连接的链接表,但我不确定如何编写代码,因为这些也是基于 Source/DestinationType 字段(交易表),其中 A = Accounts & C = 客户。已尝试编码但未成功。

我不确定如何根据 SourceType/DestinationType = Accounts 或 Customers 加入。 使用 WHERE 子句链接表或 ApplyMap()?任何建议

【问题讨论】:

    标签: join where-clause qliksense star-schema linktable


    【解决方案1】:

    希望您对 Qlik 的介绍仍然是积极的!有很多资源可以帮助您开发 Qlik 脚本功能,包括:

    就您的示例数据问题而言。如果您正在创建 Qlik Sense 应用程序,您可以使用 Qlik Data Manager 链接您的数据。

    这非常棒,因为它不仅会尝试分析您的数据并为链接字段提供有用的建议,而且还会构建脚本,然后您可以查看该脚本并将其用作进一步发展您自己的理解的基础。

    查看您的示例数据,一个选项可能是几个表之间的简单关键字段。这是如何工作的一个示例。

    [Transactions]:
    Load
    
    // User generated fields
    AutoNumberHash256 ( [DestPartyID], [SoucePartyID] )     As _keyAccount,
    
    // Fields in source data
    [TxnID],
    [TxnNum],
    [ConductorID],
    [SourcePartyType],
    [SoucePartyID]                                          As [CustID],
    [DestPartyType],
    [DestPartyID],
    [etc...]
    
    From [lib://AttachedFiles/TablesExamples.xlsx]
    (ooxml, embedded labels, table is Transactions);
    
    
    [Customers]:
    Load
    
    // User generated fields
    
    // Fields in source data
    [CustID],
    [CustFirstName],
    [CustLastName]
    
    From [lib://AttachedFiles/TablesExamples.xlsx]
    (ooxml, embedded labels, table is Customers);
    
    
    [Accounts]:
    Load
    
    // User generated fields
    AutoNumberHash256 ( [AcctID], [PrimaryAcctID] )         As _keyAccount,
    
    // Fields in source data
    [AcctID],
    [AcctNum],
    [PrimaryAcctID],
    [AcctName]
    
    From [lib://AttachedFiles/TablesExamples.xlsx]
    (ooxml, embedded labels, table is Accounts);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-11
      • 2012-01-05
      • 2011-08-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多