Solved

Dynamic Time Dimension

Posted on 2008-10-21
7
560 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now