I have 3 tables in my src data warehouse:
- src.SalesOrderItemsDelta, this table gets filled every day with a delta (changes today vs yesterday) of our order lines. Via
-
src.SalesOrderItems, this table gets filled every Saturday night with all the order lines available.
- src.preFactSalesOrderItems, this table gets filled via a custom table insert with the following table insert:
SELECT
rSalesOrderItemID]
, SapClient]
, SalesOrderNumber]
, SalesOrderItemNumber]
, SalesOrganization]
, DistributionChannel]
, Division]
, FaboryArticleNumber]
, SoldToCustomerCode]
, BinCode]
, CreatedOnDate]
, CreatedOnDateID]
, ChangedOnDate]
, ReasonForRejectionCode]
, PromisedDeliveryDate]
, PromisedDeliveryDateID]
, CommunicatedDeliveryDate]
, CommunicatedDeliveryDateID]
, PlantCode]
, SalesAmount]
, SalesCurrency]
, ItemCategoryCode]
, OrderedQuantity]
, BinQuantity]
, SalesOrderCategoryCode]
, SalesOfficeCode]
, ConfirmedDeliveryDate]
, ConfirmedDeliveryDateID]
, CommittedDeliveryDate]
, CommittedDeliveryDateID]
, RequestedDeliveryDate]
, RequestedDeliveryDateID]
, DeliveryStatusCode]
, ShipToCustomerCode]
, DocumentType]
, CustomerPONumber]
, WebshopOrderID]
, PurchaseOrderType]
, SalesDocumentType]
, Location]
, BinMainID]
, MaterialSalesID]
, MaterialGeneralID]
, MaterialPlantID]
, SoldToCustomerID]
, CustomerArticleNumberID]
, DW_TimeStamp] AS ]srcDW_TimeStamp]
, OrderReasonCode]
, OrderReasonDescription]
FROM FSalesOrderItemsDelta]
UNION
SELECT
rSalesOrderItemID]
, SapClient]
, SalesOrderNumber]
, SalesOrderItemNumber]
, SalesOrganization]
, DistributionChannel]
, Division]
, FaboryArticleNumber]
, SoldToCustomerCode]
, BinCode]
, CreatedOnDate]
, CreatedOnDateID]
, ChangedOnDate]
, ReasonForRejectionCode]
, PromisedDeliveryDate]
, PromisedDeliveryDateID]
, CommunicatedDeliveryDate]
, CommunicatedDeliveryDateID]
, PlantCode]
, SalesAmount]
, SalesCurrency]
, ItemCategoryCode]
, OrderedQuantity]
, BinQuantity]
, SalesOrderCategoryCode]
, SalesOfficeCode]
, ConfirmedDeliveryDate]
, ConfirmedDeliveryDateID]
, CommittedDeliveryDate]
, CommittedDeliveryDateID]
, RequestedDeliveryDate]
, RequestedDeliveryDateID]
, DeliveryStatusCode]
, ShipToCustomerCode]
, DocumentType]
, CustomerPONumber]
, WebshopOrderID]
, PurchaseOrderType]
, SalesDocumentType]
, Location]
, BinMainID]
, MaterialSalesID]
, MaterialGeneralID]
, MaterialPlantID]
, SoldToCustomerID]
, CustomerArticleNumberID]
, DW_TimeStamp] AS ]srcDW_TimeStamp]
, OrderReasonCode]
, OrderReasonDescription]
FROM FSalesOrderItems]
WHERE HSalesOrderItemID] NOT IN (SELECT LSalesOrderItemID] FROM FSalesOrderItemsDelta]) AND DW_TimeStamp] >= DATEADD(HOUR, -24, GETDATE())
In my STG data warehouse we have the table stg.FactSalesOrderItems which loads the src.preFactSalesOrderItems via incremental loading. During the weekend execution we have full load enabled for this table.
But the problem we see is that the stg.FactSalesOrderItems only loads data during the weekend, although the information is available in src.preFactSalesOrderItems.
Any ideas how to solve this?