2017-04-24 59 views
-1

如何消除MDX中列明智空值?MDX:如何消除列明智空值

enter image description here

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] 

回答

1

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] 
+0

(調升)點上回答 – whytheq