ssas - Max value from Member Property -
i need max value of member property use in mdx
expression.
as example adventure works i'm using following
member dofp [customer].[customer].properties("date of first purchase") member maxdofp tail ( nonempty ( [date].[date].[date] ,[measures].[dofp] ) ,1 ).item(0).membervalue select [date].[calendar year].[calendar year] on 0 ,{ [customer].[customer].&[20075] ,[customer].[customer].&[15568] ,[customer].[customer].&[20285] } on 1 [adventure works] [measures].[dofp];
i'd return june 15, 2008 rows/cols date of first purchase aaron alexander (who has max dofp of customers selected) can more calcs. instead giving me 31st dec 2010 because (i assume) that's last date in [date].[date].[date].
not pretty:
with set x { [customer].[customer].&[20075] ,[customer].[customer].&[15568] ,[customer].[customer].&[20285] } member dofp [customer].[customer].properties("date of first purchase") member maxdofp1 max(dofp) member maxdofp2 max ( x ,cdate([customer].[customer].properties("date of first purchase")) ) select [date].[calendar year].[calendar year] on 0 , x * {[measures].[maxdofp1],[measures].[maxdofp2]} on 1 [adventure works];
Comments
Post a Comment