Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Before going any further, is inventory really a slowly changing fact?</p> <p>Edit: Then why not just snapshot every product each day, since that's what you want.</p> <p>The problem is that fact tables get large and you're throwing EVERYTHING into the fact table unnecessarily. Ideally, the fact table will contain nothing more than foreign keys to dimensions and data only pertaining to the fact at hand. But some of the columns you've outlined look like they belong in one of the dimensions tables whereas </p> <p>For instance, the license plate information. Status, type, and lookup code. Likewise with netWeight/grossWeight. They should be derivable from the product dimension and PackagedAmount.</p> <pre><code>CREATE TABLE [dbo].[FactInventory]( [id] [int] IDENTITY(1,1) NOT NULL, (fact table only surrogate key) [day] [int] NULL, (day dimension key, grain of a day) [CreateDateId] [int] NULL, (create date dimension key) /* I take these are needed? * [CreateTimeId] [int] NULL, (create time dimension key) * [CreateDate] [datetime] NULL, (create date of the inventory record in src db) */ [LicensePlateId] [int] NULL, (pallet id dimension key) /* Now THESE dimension columns...possibly slowly changing dimensions? [LPStatusId] [int] NULL, (licenseplate status id dimension key) [LPTypeId] [int] NULL, (licenseplate type id dimension key) [LPLookupCode] [nvarchar](128) NULL, (licenseplate non-system name) */ [SerialNumberId] [int] NULL, (serial number id dimension key) [PackagedId] [int] NULL, (packaging type id dimension key) [LotId] [int] NULL, (inventory lot id dimension key) [MaterialId] [int] NULL, (product id dimension key) [ProjectId] [int] NULL, (customer project id dimension key) [OwnerId] [int] NULL, (customer id dimension key) [WarehouseId] [int] NULL, (warehouse id dimension key) [LocationId] [int] NULL, (location id dimension key) [PackagedAmount] [money] NULL, (inventory amount - measure) [netWeight] [money] NULL, (inventory netWeight - measure) [grossWeight] [money] NULL, (inventory grossWeight - measure) [Archived] [bit] NULL, (inventory archived yes/no - dimension) [SCDChangeReason] [nvarchar](128) NULL (auditing data for changes) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload