data warehouse - Handling change of grain for a snapshot fact table in a star-schema -


the question

how handle change in grain (from weekly measurement daily measurement) snapshot fact table.

background info

for star-schema design want incorporate results of survey fact (e.g. in week 2 of 2015 80% of respondents have responded 'yes', in week 3 76% etc.) survey conducted each week, , have access result of survey (% of people saying yes week) , not individual responses.

based on (my interpretation of) christopher adamson's "star schema: complete reference" believe should use snapshot fact table these kind of measurements.

the date dimension fact should on week-level, , conformed rollup of more fine-grained date dimension other facts in other stars take place on daily basis.

here comes trouble

now decides want conduct these surveys daily instead of weekly. best way handle this? of options i'm considering:

  • change week dimension daily one, , fake old facts if happened on last day of week.
  • change week dimension daily one, , add 7 facts each weekly one.
  • create new star, daily fact , dimension , treat old 1 aggregate.

i'd appreciate input. please tell me if logic off, or question not clear :)

i'm not convinced snapshot. each survey response represents "transaction".

with appropriate date dimension can calculate yes/no percentages, rolled week.

further, enable show results "surveys issued on sunday night more responses", or "people respond on friday more answer 'yes'". (contrived examples)


following clarification, periodic snapshot. example of bank account balance used describe similar scenario.

a key feature of periodic snapshot every combination of every dimension should present. if grain monthly, every month record fact, if has not changed previous month.

i think key problem. knowing grain may change weekly daily, make grain daily. mean you'll repeating weekly value on every day of week, true representation of knowledge of fact; on wednesday knew value same monday.

if design etl right, won't need make changes when daily updates begin.

your second option 1 i'd choose in place.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -