MDX Convert Date to Day of Week

Who is online?  0 guests and 0 members
Home  »  Forums   »  microsoft business intelligence   »  bi query languages (mdx, dmx)   » MDX Convert Date to Day of Week

MDX Convert Date to Day of Week

Topic RSS Feed

Posts under the topic: MDX Convert Date to Day of Week

Posted: 7/19/2011

Jedi Youngling 2  points  Jedi Youngling
  • Joined on: 7/19/2011
  • Posts: 1

Hi,

I am a newbie to mdx and struggling with this issue. My Dimension is structure like this:

Dimension: Business Time

Hierarchy: Business Time

Levels: Year, Month,Week,Date

 

Measures: Net Value

 

I am trying to compare sales across two years on day of the week in a particular week ie Tuesday week 29 2011 and Tuesday week 29 2010. I can get the date but unfortunately cannot get weekday as its not in the dimension.

Please advise as i have been stuck on this for two days now.


Posted: 10/11/2011

Jedi Youngling 2  points  Jedi Youngling
  • Joined on: 10/11/2011
  • Posts: 1

I found this information: http://msdn.microsoft.com/en-us/library/ms146084.aspx

This query gives you the week of year:

with member weekofyear as datepart("ww",Now())
select weekofyear on 0 from [cubename]

This query gives you the day of week:

with member dayofweek as datepart("w",Now())
select dayofweek on 0 from [cubename]

Let me know if that solves your problem.


Page 1 of 1 (2 items)