Ssas 计算MDX中的子成员数

Ssas 计算MDX中的子成员数,ssas,mdx,olap,Ssas,Mdx,Olap,如何计算当前成员的子成员数?我想打印当年给定月份的天数,如: WITH MEMBER [Measures].[Label] AS [Dim_Gregorian Calender].[MonthName].CURRENTMEMBER.MEMBER_CAPTION MEMBER [Measures].[Count] AS count(STRTOSET("[Dim_Gregorian Calender].[YMD].[Year].&[" + CStr(Format(Now(), "

如何计算当前成员的子成员数?我想打印当年给定月份的天数,如:

    WITH
MEMBER [Measures].[Label] AS [Dim_Gregorian Calender].[MonthName].CURRENTMEMBER.MEMBER_CAPTION

MEMBER [Measures].[Count] AS 
count(STRTOSET("[Dim_Gregorian Calender].[YMD].[Year].&[" + CStr(Format(Now(), "yyyy")) + "].&[2].children"))

SELECT 
{
    [Measures].[Label]
    ,[Measures].[Count]
} ON 0
,topcount([Dim_Gregorian Calender].[MonthName].[MonthName], 2) ON 1
FROM [Ret] 
现在它在count中显示了不正确的值(我需要输入一些insted&[2]来计算每一行的值)


我只需要显示两行。

我建议根据日期维度添加一个事实表来计算行数(天)。尽管如此,您也可以使用MDX解决方案:

Count(
  existing [Dim_Gregorian Calender].[YMD].[Day].Members
)