In the source relational database, there is a table called CompanySurety, with INT IDENTITY PK SuretyId which has a self-referencing ExtendsSuretyId FK column pointing to a parent SuretyId row.
Bringing this data into to a star-schema model, I've designed the CompanySurety fact table (so far) as follows:
CREATE TABLE fact_company_surety
(
SuretyCompanyDimId INT NOT NULL,
SuretyCoversCompanyAccountDimId INT NOT NULL,
SuretyReplenishPaymentCompanyAccountDimId INT NOT NULL,
-- ExtendsSuretyId -- TODO: ?????
SuretyAmountChangeDateDimId int NOT NULL,
SuretyEffectiveFromDateDimId int NOT NULL,
SuretyEffectiveThruDateDimId int NOT NULL,
SuretyExcludeCalcDateDimId int NOT NULL,
SuretyHoldingCompanyDimId INT NOT NULL,
SuretyLastRRQDateDimId int NOT NULL,
SuretyMethodDimId INT NOT NULL,
SuretyReplenishmentTypeDimId INT NOT NULL,
SuretyTypeDimId INT NOT NULL,
SuretyAccountNumberDD nvarchar(100) NOT NULL,
SuretyAmount money NULL,
SuretyBalance money NULL,
SuretyDeletedFlag bit NOT NULL,
SuretyOverrideThresholdPercent decimal(5, 2) NULL
);
The question is, how do I model this parent-child relationship in a proper dimensional way (really, how to model any parent-child hierarchy in a dimensional model)?
I've considered duplicating all the dimension and fact columns to represent the parent fact (since, at present, the hierarchy is only one level deep). But this seems wrong to me.