共用方式為


準備「經常一起購買」的輸入資料

「經常一起購買」模式是 Microsoft Cloud Retail 解決方案的一部分。 這可協助您根據客戶交易找出產品關聯和交叉銷售商機。 若要執行模型,您必須提供一些遵循零售資料模型結構描述的輸入資料。

模型的輸入資料源自 Azure Synapse Analytics 提供的零售資料模型結構描述。

筆記本執行所需的資料表

有些資料表和欄位是正確執行模型所必需的。 在部署過程中,我們使用範例資料預先填入輸入資料表,以確保順暢的客戶上線體驗。 零售商還可以自訂筆記本並將其指向不同的 Lakehouse 或更新現有資料表。

注意

輸入資料表/實體必須使用 Delta 格式。 不支援 Parquet 格式。

模型執行時需要下列資料表:

TransactionLineItem

描述:依產品和數量細分的交易組成部分,每行一個項目。

必填欄位

  • TransactionLineItemId – PK、LongType
  • TransactionId、FK 至 Transaction、LongType
  • ProductId、FK 至 RetailProduct、LongType
  • TransactionLineItemCompletedTimestamp、TimestampType
  • TransactionLineItemTypeID、FK 至 TransactionLineItemType、IntegerType
  • Quantity、DecimalType
  • ProductListPriceAmount、DecimalType
  • IsoCurrencyCode、FK 至 Currency、StringType

交易

描述:可執行工作或客戶活動的最低層級。

必填欄位

  • TransactionId、PK、LongType
  • StoreId、FK 至 Store、IntegerType
  • OrderId、FK 至 Order、LongType

TransactionLineItemType

描述:交易明細項目的類型。 此處需要 TransactionLineItemTypeName="purchase" 的記錄。

必填欄位

  • TransactionLineItemTypeID、PK、IntegerType
  • TransactionLineItemTypeName、StringType

儲存

描述:向消費者銷售產品、貨品和服務的零售/通路地點。

必填欄位

  • StoreId、PK、IntegerType
  • OperatedbyPartyId、FK 至 Party、LongType

瀏覽

描述:兩方當事人之間的訪問。 訪問方可以是當事人、員工或客戶。 受訪方可以是當事人、管道或商店。

必填欄位

  • VisitId、PK、IntegerType
  • VisitStartTimestamp、TimestampType
  • StoreId、FK 至 Store、IntegerType

順序

描述:客戶訂購產品的文件或委託。

必填欄位 -

  • Ordered、PK、LongType
  • VisitId、FK 至 visit、IntegerType

Power BI 報表所需的資料表

商店

描述:向消費者銷售產品、貨品和服務的零售/通路地點。

必填欄位

  • StoreId、PK、IntegerType
  • StoreName、StringType
  • GrossFlorArea、IntegerType
  • LocationId、FK 至 Location、IntegerType
  • OperatedByPartyId、FK to Party、LongType

當事人

描述:當事人是與業務有利益關係的個人、組織、法律實體、社會組織或事業單位。 當事人是一個概念,可讓個人、組織、法律實體、社會組織和事業單位,在角色、事件和關係的內容方面有所關聯或限定。

必填欄位-

  • PartyId、PK、LongType
  • PartyName、StringType
  • PartyTypeId、FK 至 PartyType、IntegerType

PartyType

描述:根據共同特性或類似準則對當事人進行分類。 必須有一筆 PartyTypeName = "Retailer" 的記錄

必填欄位

  • PartyTypeId、PK、IntegerType

  • PartyTypeName、StringType

位置

位置:位置是可以定義為單一緯度/經度的實際地點。 位置可用於描述實際建築物地址、業務或服務場所、元件位置或是貨件或郵件交付地點。

必填欄位

  • Locationid、PK、IntegerType
  • LocationAddressLine1、StringType
  • LocationAddressLine2、StringType
  • LocationCity、StringType
  • LocationZipCode、StringType
  • CountryId、FK 至 Country、IntegerType

國家/地區

描述:國家/地區定義是根據 ISO 3166 國碼 (地區碼) 所設定。

必填欄位 -

  • CountryId、PK、IntegerType
  • IsoCountryName、StringType
  • Iso2LetterCountryCode、StringType

零售商

描述:主要業務是直接向最終消費者銷售的商家。

必填欄位

  • RetailerId、PK、IntegerType
  • RetailerName、StringType
  • LocationId、FK 至 Location、IntegerType
  • PartyId、FK 至 Party、LongType

RetailProduct

描述:產品是任何可供應至市場、可能滿足潛在客戶所需所想的東西。 該產品是所有與其相關之物理、心理、象徵及服務屬性的總和。

必填欄位

  • ProductId、PK、LongType
  • ProductName、StringType

貨幣

描述:貨幣的定義是根據 ISO 4217 標準所設定。

必填欄位

  • IsoCurrencyCode、PK、StringType
  • CurrencyName、StringType
  • CountryId、FK 至 Country、IntegerType