在Qlikview中处理2个以上的事实表

时间:2014-10-18 13:18:14

标签: qlikview fact

我是Qlikview的新手,我正在尝试获得一个解决方案来链接超过3个Fact Table,我已经使用了“在Qlikview中处理多个事实表”的方法,并且工作得很好,但是当我尝试链接第三个表我得到一个错误的表未找到。我有3个事实表:

  1. 历史数据
  2. 销售
  3. 贷项通知单
  4. 他们所有人都必须分享这些字段:

    "Document No_",
        "Sell-to Customer No_",
        Type,
        "No_",
         Quantity,
        Amount,
        "Bill-to Customer No_",
        "Posting Date"
    

    我按照步骤1& 2

    1. 创建临时事实表:(加载所有字段)
    2. 连接密钥并删除单个密钥:
    3. 我怀疑是在哪里添加新的连接?

      这是一个例子:

      通过将各个键连接到一个表中来创建链接表: 这适用于Fact表1和2:

      [Temp_Link_Table]:
      
      LOAD DISTINCT
      'DocNum,
      'Cusnum,
      'SKU,
      'Bill2Num,
         Quantity,
          Amount,
         "Posting Date"
       RESIDENT [Temp_Sales_Line] ;
      
       CONCATENATE ([Temp_Link_Table])
      
       LOAD DISTINCT
      
      DocNum,
      Cusnum,
      SKU,
       Quantity,
          Amount,
         "Posting Date"   
      
      RESIDENT [Temp_Hist_Sales];
      

      我应该如何连接3?

      CONCATENATE ([Temp_Link_Table])
      
       LOAD DISTINCT
      
      DocNum,
      Cusnum,
      SKU,
       Quantity,
          Amount,
         "Posting Date"   
      
      RESIDENT [Temp_Credit_Memo]?????????????????????????????????
      
      /**
       * The final Link Table will contain all of the individual keys one time as well as your concatenated keys
       */
      
      [Link_table]:
      
       LOAD DISTINCT
      
         "Posting Date",
        DocNum,
       Cusnum,
       SKU,
       Quantity,
       Amount,
      
      
      
      DocNum &'_'&Cusnum  &'_'& SKU  &'_'& Bill2Num  &'_'&  Quantity  &'_'&Amount &'_'&[Posting Date]     AS Sales_Key, 
      DocNum &'_'&Cusnum  &'_'& SKU&'_'&  Quantity  &'_'&Amount &'_'&[Posting Date]   AS Hist_Sales_Key,
      DocNum &'_'&Cusnum  &'_'& SKU  &'_'& Bill2Num  &'_'&  Quantity  &'_'&Amount  &'_'&"Posting Date"    AS CreditMemo_Key
      
       RESIDENT [Temp_Link_Table];
      
      
       DROP TABLE [Temp_Sales_Line];
       DROP TABLE [Temp_Hist_Sales];
       DROP TABLE [Temp_CM];
      DROP TABLE [Temp_Link_Table];
      

0 个答案:

没有答案