Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 572
  • Last Modified:

Dynamic Time Dimension

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
bminetwork2277
Asked:
bminetwork2277
  • 4
  • 3
2 Solutions
 
PedroCGDCommented:
you have the week attribute in your time dimension, correct?
Do you have created the hiearchy with date < week < month < quarter < year?
regards
0
 
bminetwork2277Author Commented:
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
 
PedroCGDCommented:
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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
bminetwork2277Author Commented:
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
 
PedroCGDCommented:
If you want the difference between the two, create a calculated member.
Regards
0
 
bminetwork2277Author Commented:
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
 
PedroCGDCommented:
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now