dbTalk Databases Forums  

linking time dimensions

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss linking time dimensions in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
stewart whaley
 
Posts: n/a

Default linking time dimensions - 10-01-2003 , 02:37 PM






I have a cube with 2 independent time dimensions and I need to create
a calculated measure that returns the number of fact table records
where the
members of the 1st time dimension are the same as the members of the
second time dimension; eg: Count= X where Dimension1=May2002 AND
Dimension2=May2002.

I can do this with an MDX query if I know what members from Dimension1
will be selected. Problem is, I don't know what the user is going to
select and I've tried for 2 DAYS to come up with a dynamic solution

A response by Chris Webb to a similar scenario looks promising but I'm
still going in circles because this needs to be dynamic. (link to
Chris's post:
http://groups.google.com/groups?hl=e...gbl%26rnum%3D1)

Using my cube as an example, the user will select:
SELECT { [Measures].[Count] } ON COLUMNS ,
{[WorkOrder Type].[Type].&[PM] }
ON ROWS
FROM [ClinicalEngineering_DB]
WHERE ( [Open Date].[Year].&[2004].&[200308])

I need a measure that returns the count of records where the members
in my second dimension ([Close Date]) are the same as the members in
my first ([Open Date]). In this case I'd need the count where [Open
Date].[Year].&[2004].&[200308] AND [CLOSE
Date].[Year].&[2004].&[200308].

Thanks,
Stewart




Thanks,
Stewart

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: linking time dimensions - 10-02-2003 , 01:44 AM






Based on Chris's suggestion, is this what you want:

Quote:
With Member [Measures].[SameClose] as
'([Measures].[Count],
LinkMember([Open Date].CurrentMember,[Close Date]))'

SELECT { [Measures].[SameClose] } ON COLUMNS ,
{[WorkOrder Type].[Type].&[PM] }
ON ROWS
FROM [ClinicalEngineering_DB]
WHERE ( [Open Date].[Year].&[2004].&[200308])
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.