Cortex Framework v6 相容性

v6 相容性內容可在 Cortex Framework v7 架構中,為 Cortex Framework v6 工作負載提供與結構定義相容的層。這樣一來,您就能遷移至 Cortex Framework 第 7 版,而不必中斷現有的數據分析資產,例如 Looker 資訊主頁或 LookML 語意模型。

支援的資料來源

這個框架提供 SAP ECC 和 SAP S/4HANA 資料來源的 v6 相容性內容。

運作方式

第 6 版相容性內容可做為第 7 版資料模型與舊版報表資產之間的轉接程式:

  • 與結構定義相容的檢視畫面:顯示報表資料檢視名稱、資料欄和大小寫,與 Cortex Framework (第 6 版) 中完全相同。
  • 目標隔離:將相容性檢視區塊部署在獨立命名空間 (cortex_v6_compatibility) 和專屬 BigQuery 目標資料集中,藉此將相容性檢視區塊與核心 Cortex Framework 資料表隔離。

部署相容性內容

如要部署 Cortex Framework v6 相容性內容,請完成下列步驟:

  • 設定專用的 BigQuery 目標資料集。
  • config.yaml 檔案中啟用 v6 相容性模組。
  • 執行 Google Cloud Cortex Framework 建構和部署指令碼。
  • 執行 Dataform 管道。

專屬目標資料集

您必須將 v6 相容性內容部署至另一個 BigQuery 資料集。這可避免命名空間遮蔽和實體資料表衝突,因為相容性內容使用的許多資料表與 Cortex Framework v7 核心資料表共用相同的實體名稱 (例如 cost_centersprofit_centersbillingdeliveries)。

如要建立專屬的 BigQuery 資料集,請在 config.yaml 檔案中新增 cortex_v6_compatibility_target

data:
  datasets:
    - id: product_target
      projectId: YOUR_TARGET_PROJECT_ID
      datasetId: prod_sap_dataproducts # Core v7 tables
    - id: cortex_v6_compatibility_target
      projectId: YOUR_TARGET_PROJECT_ID
      datasetId: prod_sap_cortex6 # Compatibility v6 tables

設定 Cortex Framework

如要在 config.yaml 檔案中註冊及啟用相容性層,請完成下列工作:

  • 設定專屬目標資料集。
  • 註冊相容性命名空間。
  • 針對下列所有 Cortex Framework v6 相容性模組,將 enabled 屬性設為 true

  • sap_cortex_v6_compatibility_master_data

  • sap_cortex_v6_compatibility_accounts_payable

  • sap_cortex_v6_compatibility_finance

  • sap_cortex_v6_compatibility_inventory

  • sap_cortex_v6_compatibility_purchasing

  • sap_cortex_v6_compatibility_sales

以下範例說明啟用 sap_cortex_v6_compatibility_inventory 時必須進行的設定變更:

data:
  datasets:
    - id: cortex_v6_compatibility_target
      projectId: YOUR_TARGET_PROJECT_ID
      datasetId: prod_sap_cortex6

  namespaces:
    - name: cortex_v6_compatibility
      path: ../src/data_modules/cortex_v6_compatibility

  modules:
    products:
      - moduleId: sap_cortex_v6_compatibility_inventory
        modulePath: cortex_v6_compatibility.sap.products.inventory
        enabled: true # If using configuration file based on config.yaml.example, ensure the `enabled` flag is set to `true`
        syncToKc: false
        dependencyBindings:
          sapModule: erp
          sapMasterData: sap_cortex_v6_compatibility_master_data
          sapSales: sap_cortex_v6_compatibility_sales
        dataTargetId: cortex_v6_compatibility_target
        moduleSettings:
          targetCurrencies: ['USD']
          rateType: 'M'
          languages: ['E']

#    You must ensure the `enabled` flag is set to `true` for all of the listed dependent modules. In this example:
#   `sap_cortex_v6_compatibility_master_data`
#   `sap_cortex_v6_compatibility_sales`

營運規定

強烈建議您同時啟用所有 Cortex Framework v6 相容性模組。相容性內容包含跨模組依附元件 (例如,帳單檢視畫面依附於主資料表,而庫存快照檢視畫面依附於日曆維度)。同時啟用這兩項功能,可避免 Dataform 發生依附元件錯誤。

商品目錄快照

您必須將商品目錄快照資料表 (stock_weekly_snapshotsstock_monthly_snapshots) 設定為累加式資料表,並執行這些資料表。 在 Cortex Framework 第 6 版中,庫存快照會計算庫存數量和價值的累計總和:

  1. 初始執行:資料表會處理所有移動交易記錄,以建立起始庫存量。
  2. 後續執行:Dataform 只會處理上次執行快照後發布的異動,並將這些異動加到前一週期的累計總計中。

如果您以完整重新整理 (非累加) 模式執行這些資料表,系統每次執行時都會從頭重新計算整個移動記錄。這種做法效率極低、成本高昂,而且如果來源表格包含日期間隔,可能會導致累計計算錯誤。請將這些資料表的具體化類型設為遞增 (預設設定)。

建構及部署相容性內容

如要建構及部署相容性內容,請按照「部署」和「部署後」說明文件中的指示操作。