dbTalk Databases Forums  

Time dimension trouble

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


Discuss Time dimension trouble in the microsoft.public.sqlserver.olap forum.



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

Default Time dimension trouble - 06-22-2004 , 06:36 AM






I have a time dimension, [Time], which consists of levels:
- Year
- Month
- Day

My users wanted a way to select current year and current month so i gave
them calculated members which i added to the all level of the time dimension
(this example is for current year):
strToMember("[Time].[Year].&[" + DatePart("yyyy", Now()) + "]")

Now my users also want a member thats "same month last year". Ie. they want
to select [Time].[All].[This Month] And [Time].[All].[This month last year].

parallelperiod([Time].[Year], 1, [Time].[All].[This Year]) does not seem to
work (gives me empty cells), any ideas on how to solve this?



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

Default Re: Time dimension trouble - 06-23-2004 , 12:37 AM






I assume that you meant:

ParallelPeriod([Time].[Year],1,[Time].[All].[This Month])

The problem is that [Time].[All].[This Month] is a Calculated Member, so
hierarchical functions won't work. Try replacing the member with its MDX
expression, like:
Quote:
ParallelPeriod([Time].[Year],1,
StrToMember("[Time].[Month].["
+ CStr(DatePart("m", Now())) + "/"
+ CStr(DatePart("yyyy", Now())) + "]"))
Quote:

- Deepak

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


Reply With Quote
  #3  
Old   
Niki
 
Posts: n/a

Default RE: Time dimension trouble - 06-29-2009 , 02:26 PM



This sounds similar to the issue we have. Any help is appreciated. We have the different dimensions built. But can only select any one iof the Time Dimension for the views. Need to have 3 Daily, WeekToDate and MonthToDate side by side all in one single row displaying the measures. What code would place them side by side as calculated measures. Thanks for your assistance.

From http://www.developmentnow.com/g/112_...on-trouble.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/

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.