Unix Technical Forum

MDX expression in MSAS

This is a discussion on MDX expression in MSAS within the SQL Server Data Warehousing forums, part of the Microsoft SQL Server category; --> Hi, I would like to add new Calculated Member and build MDX expression that evaluate it. I've got an ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server Data Warehousing

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 05:05 PM
Edmo
 
Posts: n/a
Default MDX expression in MSAS

Hi,
I would like to add new Calculated Member and build MDX expression that
evaluate it. I've got an Amount measure and want to add Sum_Amount
calculated member. Here is an example how it should work:

Amount Sum_Amount
01 Jan 2002 100 100
02 Jan 2002 200 300
03 Jan 2002 150 450

The Sum_Amount value for a specified day is a:
1) sum of Amount value for the day and Sum_Amount value for the previous
day (see 03 Jan 2002: 150 + 300 = 450)

or
2) sum of Amount values from the beginning of the year up to specified
day (eg. if the specified day is 03 Jan 2002 it should be: 100+200+150 =
450)

Additionally, the value of Sum_Amount should start with '0 + Amount' for
every year (see example - 01 Jan 2002 we have 0 + 100 = 100). It should
work on every level of the time hierarchy, I mean Year-Quarter-Month-Day.
I don't know how to do it.
could anyone tell me how the expression that evaluate it should be?
thanks

Edmo

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 05:05 PM
Edmo
 
Posts: n/a
Default Re: MDX expression in MSAS



Marius Dumitru [MS] wrote:
> Please consider using the PeriodsToDate function, e.g.:
>
> Create Member MyCube.Measures.SumAmount As 'Sum(PeriodsToDate(Time.Year),
> Measures.Amount)'


thanks very much,
looks, it works
I made my own expression but much more complicated and it had some bugs.
I felt a little ashamed when I saw how easy it can be.
thanks once again

Edmo

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com