如何消除MDX中的列式空值?
WITH MEMBER [ReportName] AS [DimReport].[Report Key].CurrentMember.Member_Caption
MEMBER [ReportKey] AS [DimReport].[Report Key].CurrentMember.UniqueName
MEMBER [ReportWiseLatestDate] AS TAIL(NonEmpty([DimAnchorDate].[Date Key].[Date Key],[Measures].[DrPatientKeyCnt]),1).Item(0).MemberValue
SELECT
{[ReportName],[ReportKey],[ReportWiseLatestDate]} ON COLUMNS,
{[DimReport].[Report Key].[Report Key]} ON ROWS
FROM
[PopulationReportCube]
答案 0 :(得分:2)
NonEmpty()函数可以解决问题:
WITH MEMBER [ReportName] AS [DimReport].[Report Key].CurrentMember.Member_Caption
MEMBER [ReportKey] AS [DimReport].[Report Key].CurrentMember.UniqueName
MEMBER [ReportWiseLatestDate] AS TAIL(NonEmpty([DimAnchorDate].[Date Key].[Date Key],[Measures].[DrPatientKeyCnt]),1).Item(0).MemberValue
SELECT
{[ReportName],[ReportKey],[ReportWiseLatestDate]} ON COLUMNS,
NonEmpty({[DimReport].[Report Key].[Report Key]}, [ReportWiseLatestDate]) ON ROWS
FROM
[PopulationReportCube]