Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

If I have a table such as...:

YYMM | Sales
------------
1201 | 10
1202 | 20
1203 | 30
1204 | 40

... then I might describe this as having a time dimension. If I wanted to calculate a year-to-date value of Sales, would "year to date" be a different dimension to time, or is it actually the same and the additional measure implies the different meaning? Such as:

YYMM | Sales | SalesYTD
-----------------------
1201 | 10    | 10
1202 | 20    | 30
1203 | 30    | 60    
1204 | 40    | 100
share|improve this question
add comment

1 Answer

Year to date sales is a different measure. Depending on your platform (OLAP systems, for example) it may be purely calculated on the fly. If you have an appropriate unit of analysis to do so, store it, otherwise calculate it on the fly.

share|improve this answer
    
May I ask what you mean by an appropriate unit of analysis? I think you mean something like "an appropriately grained dimension". Is that right? –  jl6 Apr 25 '12 at 9:53
    
Combination of dimensions (e.g. product, sales agent ...) and a rollup of time. What you calculate must be additive across anything you want to slice it by, so you can't have multiple incremental YTD figures for the same thing appearing in the slice. –  ConcernedOfTunbridgeWells Apr 25 '12 at 10:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.