SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Star Schema Design - Identifying Facts
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

flamblaster
Constraint Violating Yak Guru

384 Posts

Posted - 11/02/2012 :  00:59:06  Show Profile  Reply with Quote
As I've said before in other posts the business I need to measure is a public transit system. The types of attributes we normally have are:

Employee
RouteNumber
Date
PassengerClassification
NonPassengerClassification
Vehicle
Trip (more like voyage, includes direction of travel, time of day etc)

The measurements we normally work with which should be translated to facts are:

NumberPassengers
NumberServiceMiles
NumberRevenueMiles
NumberDeadheadMiles
NumberServiceHours
NumberRevenueHours
NumberDeadheadHours
NumberLayoverHours
NumberPerformedTrips (voyages)
NumberCancelledTrips
NumberServiceDays

My challenge is to figure out whether or not I need to maybe combine some of the measurements into single fact tables, or if it is important to keep them separated. For example, miles and hours almost always go hand in hand as they will directly relate to a voyage (one trip will have distance and timespan columns). However, notice that hours has one addiitonal fact - NumberLayoverHours. You can't have layoverMiles, it just doesn't exist. Would it make sense to pull all the mile attributes into one fact table? Oor do you see them being parted out?

Thanks!

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 11/02/2012 :  05:18:01  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
Depends on the granularity of the fact table.
Do the measures use the same dimension keys and does it make sense in that fact table to aggregate the measures over the same dimesnion filters?
If so they can go in the ame fact table otherwise separate - and maybe combined in an aggregate fact table.

It sounds like your fact table might be dealing with trips in which case it makes sense to include the layover hours in that table - it doesn't matter that there won't be a measure for layover miles.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

flamblaster
Constraint Violating Yak Guru

384 Posts

Posted - 11/04/2012 :  00:04:01  Show Profile  Reply with Quote
Awesome...That makes sense...this part: " it doesn't matter that there won't be a measure for layover miles." is the main concept that I'm looking for. And to answer the questions about the dimension filters, yes, they would mean the same things...I was more concerned about accidentally setting things up where you could misrepresent the aggregates by having sums of different levels of granularity side by side (ie month and day in the same report) this would obviously cause problems if you were trying to show a total for a month and a total for a day side by side.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000