Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:49:07+00:00 2026-05-22T21:49:07+00:00

I have some entities in my Data Warehouse: Person – with attributes personId, dateFrom,

  • 0

I have some entities in my Data Warehouse:

  1. Person – with attributes personId, dateFrom, dateTo, and others those can be changed, e.g. last name, birth date and so on – slowly changing dimension

  2. Document – documentId, number, type

  3. Address – addressId, city, street, house, flat

The relations between (Person and Document) is One-To-Many and (Person and Address) is Many-To-Many.

My target is to create history fact table that can answer us following questions:

  1. What persons with what documents lived at defined address on defined date?

2, What history of residents does defined address have on defined interval of time?

This is not only for what DW is designed, but I think it is the hardest thing in DW’s design.

For example, Miss Brown with personId=1, documents with documentId=1 and documentId=2 had been lived at address with addressId=1 since 01/01/2005 to 02/02/2010 and then moved to addressId=2 where has been lived since 02/03/2010 to current date (NULL?). But she had changed last name to Mrs Green since 04/05/2006 and her first document with documentId=1 to documentId=3 since 06/07/2007. Mr Black with personId=2, documentId=4 has been lived at addressId=1 since 02/03/2010 to current date.

The expected result on our query for question 2 where addressId=1, and time interval is since 01/01/2000 to now, must be like:

Rows:

last_name="Brown", documentId=1, dateFrom=01/01/2005, dateTo=04/04/2006

last_name="Brown", documentId=2, dateFrom=01/01/2005, dateTo=04/04/2006

last_name="Green", documentId=1, dateFrom=04/05/2006, dateTo=06/06/2007

last_name="Green", documentId=2, dateFrom=04/05/2006, dateTo=06/06/2007

last_name="Green", documentId=2, dateFrom=06/07/2007, dateTo=02/01/2010

last_name="Green", documentId=3, dateFrom=06/07/2007, dateTo=02/01/2010

last_name="Black", documentId=4, dateFrom=02/03/2010, dateTo=NULL

I had an idea to create fact table with composite key (personId, documentId, addressId, dateFrom) but I have no idea how to load this table and then get that expected result with this structure.

I will be pleased for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:49:08+00:00Added an answer on May 22, 2026 at 9:49 pm

    Interesting question @Argnist!

    So to create some common language for my example, you want a

    • DimPerson (PK=kcPerson, suggorate key for unique Persons=kPerson, type 2 dim)
    • DimDocument (PK=kcDocument, suggorate key for unique Documents=kDocument, type 2 dim)
    • DimAddress (PK=kcAddress, suggorate key for unique Addresses=kAddress, type 2 dim)

    A colleague has written a short blog on the usage of two surrogate keys to explain the above dims ‘Using Two Surrogate Keys on Dimensions‘.

    I would always add
    DimDate with PK in the form yyyymmdd
    to any data warehouse with extra attribute columns.

    Then you would have your fact table as

    • FactHistory (FKs=kcPerson, kPerson, kcDocument, kDocument, kcPerson, kPerson, kDate)
      plus any aditional measures.

    Then joining on the “kc”s you can show the current Person/Document/Address dimension information.
    If you joined on the “k”s you can show the historic Person/Document/Address dimension information.

    The downside of this is that this fact table needs one row for each person/document/address/date combination. But it really is a very narrow table, since the table just has a number of foreign keys.

    The advantage of this is it is very easy to query for the sorts of questions you were asking.

    Alternatively, you could have your fact table as

    • FactHistory (FKs=kcPerson, kPerson, kcDocument, kDocument, kcPerson, kPerson, kDateFrom, kDateTo)
      plus any aditional measures.

    This is obviously much more compact, but the querying becomes more complex. You could also put a view over the Fact table to make it easier to query!

    The choice of solution depends on the frequency of change of the data. I suspect that it will not be changing that quickly, so teh alternate design of the fact table may be better.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In CoreData, I have the data graph with some entities, and each object is
So I've got some data. There are entities. Entities have an arbitrary number of
Here I have some entities in core data, for example, Account, and I wish
I have some data coming out of an DB that I can't readily change
I have written some data fetch service which fetches some entities from main web
I have 2 lists and the entities of the those lists have some IDs
I have some Entities holding values for my program. E.g. a Person Entity has
I have some HTML data (over which I have no control, can only read
I have some entities in core data, and they are all sub classes of
I have a core data model with some entities set up. I have set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.