| MDX-I would like to create calculated measure that instead of summing children amounts,uses last child |
| Written by Vidas Matelis | |||
| Tuesday, 17 April 2007 19:09 | |||
|
Q: I would like to create MDX calculated measure that instead of summing children amounts,uses last child amount A: Normally best way to create this in SSAS 2005 is to create real measure with aggregation function LastChild. If for some reason you still need to create calculated measure, just use fuction .LastChild on current member of Date dimension, and you will allways get value of last period child. Example: We want to see last semester value for year level data. Lets first see what data values are at Calendar Semester level:
Result:
Now lets create calculated measure that instead of aggregating values from the level below, uses last child value:
Result:
As you see instead of seeing sum for semesters, you see last semesters value for each year.
|
Most read
- How to install Adventure Works SQL DW and Analysis Services 2005/2008 sample database and project
- MDX-How can I get Last (Previous) Year to Date (YTD) values?
- What TCP port SQL Server Analysis Services 2005 uses
- MDX-How do you calculate monthly average of one year, optionally including empty months?
- MDX-How do I calculate sales for 12 Month to date?







