dbTalk Databases Forums  

Calculated member behaviour?

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


Discuss Calculated member behaviour? in the microsoft.public.sqlserver.olap forum.



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

Default Calculated member behaviour? - 09-04-2006 , 04:36 AM






I am having trouble understanding how a calculated member (on a
non-measure dimension) intersects with other hierarchies on the same
dimension.
A good example of this is dates.
If I have a calculated member to set the [Date].[Month of Year], then
does this create a meaningful crossjoin with [Date].[Date].

I would like to have a dynamically calculated [Date].[Month of
Year].[CurrentPeriod] and have reports where I can easily enumerate the
dates in that period, just as if I had referenced the month by name or
key.

I have AS 2005 SP1 and the example MDX below was run in Management
Studio against the AdventureWorks database.

The query as written works very slowly and generates a row for *every*
date in the database.
If I take away the curly braces from the slicer it works fine!
If I use strtomember in the calculated member definition the it goes
bad again.
Can someone *please* explain what is going on.


-----------------
WITH
MEMBER [Date].[Month of Year].[CurrentP1] AS
Aggregate([Date].[Month of Year].&[9])

SELECT {[Measures].[Sales Amount]} ON 0,

{[Date].[Date].[All Periods].children} ON 1

FROM [Adventure Works]

WHERE {([Date].[Month of Year].[CurrentP1])}


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.