A fact table for property inspections
2 posters
Page 1 of 1
A fact table for property inspections
I'm building a dw that stores natural disaster data. I'm working on the Inspection piece now and the trouble I'm having is this.
Different kinds of inspections were done on houses, each inspection having its own set of requirements so that not every inspection will look at the same things (i.e. some just look at if the home is occupied, others look at plumbing, electrical, foundation, etc.)
The grain of my fact table should be by the inspection date (it is nearly a factless fact table)
Most of the time people will only want to see there was an inspection done and when it was done.
However, I do need to store the results of the inspections.
I don't know if my current structure is really appropriate considering that other items could come up that need to be added to the inspection requirements.
I welcome all suggestions on improving my current structure (forgive me this is a small sample of my data columns, and I just typed them in short-hand)
I currently have a fact table like this:
FactInspectKey
InspectDateKey
InspectorKey
InspectionTypeKey
DataSourceKey
LoadDateTime
DimDate
DateKey
Month
Year
DimDataSource
DataSourceKey
DataSourceName
DimInspector
InspectorKey
DimInspectionType
InspectionTypeKey
And a "junk dimension" like this with a snow flake schema for comments, condition, and placard (which I don't really like)
DimInspectDetail
InspectDetailKey
NumOfOccupants
SafeToEnterFlag
DemoFlag
ArcheologistFlag
ReinspectionFlag
ViolationFlag
ViolationCommentKey
CommentKey
PercentDamaged
NumOtherStruct
FloorConditionKey
HeatingACConditionKey
GeneralConditionKey
ElectricalConditionKey
WaterDepthInInches
InteriorConditionKey
DimPlacard
PlacardKey
PlacardColor
PlacardDefinition
DimCondition
ConditionKey
Condition
ConditionDefinition
DimComment
CommentKey
Comment
Different kinds of inspections were done on houses, each inspection having its own set of requirements so that not every inspection will look at the same things (i.e. some just look at if the home is occupied, others look at plumbing, electrical, foundation, etc.)
The grain of my fact table should be by the inspection date (it is nearly a factless fact table)
Most of the time people will only want to see there was an inspection done and when it was done.
However, I do need to store the results of the inspections.
I don't know if my current structure is really appropriate considering that other items could come up that need to be added to the inspection requirements.
I welcome all suggestions on improving my current structure (forgive me this is a small sample of my data columns, and I just typed them in short-hand)
I currently have a fact table like this:
FactInspectKey
InspectDateKey
InspectorKey
InspectionTypeKey
DataSourceKey
LoadDateTime
DimDate
DateKey
Month
Year
DimDataSource
DataSourceKey
DataSourceName
DimInspector
InspectorKey
DimInspectionType
InspectionTypeKey
And a "junk dimension" like this with a snow flake schema for comments, condition, and placard (which I don't really like)
DimInspectDetail
InspectDetailKey
NumOfOccupants
SafeToEnterFlag
DemoFlag
ArcheologistFlag
ReinspectionFlag
ViolationFlag
ViolationCommentKey
CommentKey
PercentDamaged
NumOtherStruct
FloorConditionKey
HeatingACConditionKey
GeneralConditionKey
ElectricalConditionKey
WaterDepthInInches
InteriorConditionKey
DimPlacard
PlacardKey
PlacardColor
PlacardDefinition
DimCondition
ConditionKey
Condition
ConditionDefinition
DimComment
CommentKey
Comment
HawkeyeDBA- Posts : 2
Join date : 2014-03-06
Re: A fact table for property inspections
You may want to consider multiple fact tables. Have one at the inspection level to handle the more common queries, and have one or more fact tables with detailed inspection results. The number of such tables would depend on the nature of the inspections and the disparity between them. The results tables would have the same dimensions as the high level fact along with other dimensions relating to what was inspected and possibly a metric or two that rates the condition of what was inspected.
Re: A fact table for property inspections
Thank you so much for your input. I actually was considering that same type of design. I keep forgetting it is OK to have the same bits of data in multiple locations throughout my design. I still fight the oltp side of me :-)
HawkeyeDBA- Posts : 2
Join date : 2014-03-06
Similar topics
» 'Routing' the grain of the fact table to multpile members of multiple dimensions causes the fact table to 'explode'
» Integrating new fact table which has one to many relationship with the main fact table in existing star schema
» How to create fact table with measures derived from comparing two fact table rows
» Healthcare Hospital Stay fact table - transaction fact table - a row for In and a row for Out?
» Design a snapshot Fact table in data mart from compliance-enable fact table in enterprise data warehouse
» Integrating new fact table which has one to many relationship with the main fact table in existing star schema
» How to create fact table with measures derived from comparing two fact table rows
» Healthcare Hospital Stay fact table - transaction fact table - a row for In and a row for Out?
» Design a snapshot Fact table in data mart from compliance-enable fact table in enterprise data warehouse
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum