mardi 27 mai 2014

Un data warehouse - Star Schema a expliqué - Stack Overflow


I am Mapping a star schema from the start, and i have a question that i cant find an answer.


Picture that i have a model wich involve Client, Store , Adress, Time (Dimmensions) and Sale (fact). Ok, that is easy to model, but i get a "conceptual" question. I have to add a Newsletter Dimmension to the star, and this newsletter can lead the customer to buy something.


So, in my report/cubes i need to know (in a period):


1 How many Newsletter lead to a Sale,


2 How many Newsletter have been generated.


Where should i place the generate_date of Newsletter? If i place it in FACT table, but if this Newsletter did not lead to a Sale, there will be no date in FACT table.


If i place it on Newsletter and join it to Time, i would be breaking the Star schema?


How do i solve this :S


I have many other cases that is the same question, like client join_date.


Thanks




As far as I understood! Why your making Sale as a Dimension and Store as a Fact? Normally Fact table contains Transactional data and I think Sale is Transactional. But this is my assumption as you haven't described what type of data it contain.


As far as Newsletter is concerned! Yes you can add just like other dimensions you have added but to get desired result! You also have to add Customer Dimension.


Place generate_date in Date dimension and place Date ID in Fact table.


You cannot join Newsletter with Time as it will break Start Schema rules.


This link might be helpful to you.



I am Mapping a star schema from the start, and i have a question that i cant find an answer.


Picture that i have a model wich involve Client, Store , Adress, Time (Dimmensions) and Sale (fact). Ok, that is easy to model, but i get a "conceptual" question. I have to add a Newsletter Dimmension to the star, and this newsletter can lead the customer to buy something.


So, in my report/cubes i need to know (in a period):


1 How many Newsletter lead to a Sale,


2 How many Newsletter have been generated.


Where should i place the generate_date of Newsletter? If i place it in FACT table, but if this Newsletter did not lead to a Sale, there will be no date in FACT table.


If i place it on Newsletter and join it to Time, i would be breaking the Star schema?


How do i solve this :S


I have many other cases that is the same question, like client join_date.


Thanks



As far as I understood! Why your making Sale as a Dimension and Store as a Fact? Normally Fact table contains Transactional data and I think Sale is Transactional. But this is my assumption as you haven't described what type of data it contain.


As far as Newsletter is concerned! Yes you can add just like other dimensions you have added but to get desired result! You also have to add Customer Dimension.


Place generate_date in Date dimension and place Date ID in Fact table.


You cannot join Newsletter with Time as it will break Start Schema rules.


This link might be helpful to you.


0 commentaires:

Enregistrer un commentaire