Solved

Dynamic Time Dimension

Posted on 2008-10-21
7
561 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
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Creating and Managing Databases with phpMyAdmin in cPanel.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now