Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Dynamic Time Dimension

Posted on 2008-10-21
7
Medium Priority
?
571 Views
Last Modified: 2013-11-16
I have an SQL Server Analysis Services (SSIS) Project that contains an order measure group and a project dimension.  The project has a field that contains the start of the project.  When I analyze measures in the order measure group along a time dimension I want a breakdown by week but have my weeks start date be the start date of the project.  

For example If you analyze the measure by week, all orders in project 1 that have an order date within one week of the project start date would be totaled in week 1.  All orders in project 2 that have an order date within one week of project 2's start date would be listed under week 1 as well.  This could result in totals from the order measure group that are years apart being totaled in the same week.

I hope that's a clear enough explanation.
0
Comment
Question by:bminetwork2277
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 22

Expert Comment

by:PedroCGD
ID: 22775449
you have the week attribute in your time dimension, correct?
Do you have created the hiearchy with date < week < month < quarter < year?
regards
0
 
LVL 1

Author Comment

by:bminetwork2277
ID: 22776717
Yes I have a week attribute and it is part of a hierarchy.  But the time dimension is linked by a static date.  But that doesn't fix my problem.  Let me try an example.

Order 1 has a project start date of 01/01/08 and a received date of 01/08/08
Order 2 has a project start date of 01/08/08 and a received date of 01/08/08

Because order 1's received date is a week after it's start date I need it to be listed in week 2 because it was received in the second week of the project.  Order 2's received date is the same as it's start date so it was received in the first week of the project.  

Even though they both have the same received date they need to be displayed in different weeks.  The week they are placed in is a relative value that needs to be re-evaluated on each record.  There is no way I'm aware of to do this with a standard time dimension because when you link two records to time on the same date, you will always receive the same week back.
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 22777772
Do you have a Foreign key in your fact to your time dimension, correct?

1. Do you tried to create a this FactTable as a view/namedquery with the right foreign key to time dimension?
2. Do you tried to have 2 foreign keys... one for start date and other for receive date?

regards
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 1

Author Comment

by:bminetwork2277
ID: 22783092
1.  The fact table (Orders) has a foreign Key field (Received Date) to the time dimension.
2.  That would allow me to group the records by either the start date or the received date, but not the difference between the two.
0
 
LVL 22

Expert Comment

by:PedroCGD
ID: 22783681
If you want the difference between the two, create a calculated member.
Regards
0
 
LVL 1

Accepted Solution

by:
bminetwork2277 earned 0 total points
ID: 22792674
Can you show me how to create a calculated member that would find the difference between two dates rounded to, and displayed in weeks.
0
 
LVL 22

Assisted Solution

by:PedroCGD
PedroCGD earned 2000 total points
ID: 22794646
ok...
give me an excel in one sheet waht you have, in other what you want.
And the script create table of your time dimension and fact you you can!
Regards
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question