Showing posts with label reflect. Show all posts
Showing posts with label reflect. Show all posts

Sunday, March 25, 2012

Creating Time Dimension for seconds

I'm creating analysis cubes on data that needs to reflect it's distribution over time during a 4 hour period.

I'd like to create a Time Dimension for "Every 15 seconds"

I've already got a DIM_Time table that includes actual event times (down to milliseconds)

Do I just need to create fields on that data for the 0:15 block that the particular event falls in, and create records for every 0:15 even if there isn't a related row in the measures table?

So that...

Measures
ID TimeId Measure
1 1 100
2 2 200

DIM_Time
TimeId Time
1 0:01.1234
2 0:31.2345
3 0:15
4 0:30
5 0:45
6 1:00
7 1:15
etc...

Hi Greg,

You're on the right track. The reason you would put the 15 second block even if there isn't an actual time for that is later on down the road there may be a fact for that and you would simply add the fact without have to also add the dimension member. You also may want to see for some reason the times that don't have data.

Depending on the requirements, I might break the Min and Seconds out in seperate fields. Like

TimeID Hour Min Sec Actual Time

1 0 0 0 0:10:00

2 0 0 15

3 0 0 45

4 0 1 0

Depending if the facts needs to roll up to a Min. and Hour.

Hope this helps,

David Botzenhart

|||Thanks! I appreciate your clarifications on the table structure