取最大值的那天MDX

with
member mydate as now()
MEMBER theYear as year(mydate)
MEMBER theMonth as month(mydate)
MEMBER theDay as day(mydate)
MEMBER AAA AS MAX
(
descendants(
strtomember("[时间].[日期层次].[月].&["+format(mydate,"yyyy年MM月") + "]"),
[时间].[日期层次].[日]
),[Measures].[TCH信道数]
)
 
MEMBER MAXDATE AS filter
(
     DESCENDANTS([时间].[日期层次].[年].&[2011年].&[2011年季度].&[2011年月],[时间].[日期层次].[日]),
     [Measures].[TCH信道数]=AAA
).item(0).name

select
{
 [Measures].AAA,
 [Measures].[TCH信道数],
 MAXDATE
}on 0,
{
descendants(
strtomember("[时间].[日期层次].[月].&["+format(mydate,"yyyy年MM月") + "]"),
[时间].[日期层次].[日]
)
}on 1

from [CELL]

原文地址:https://www.cnblogs.com/honkcal/p/2229599.html