简体   繁体   中英

Missing value of measure (calculated member )

I've got a data warehouse which is underlying database of OLAP cube. When I run query like that:

SELECT  dimS.Attribute2,SUM(fact.LastValue)
FROM FactTable fact
JOIN DimS dimS ON fact.DimSKey = DimS.DimSKey
GROUP BY DimSKey.Attribute2 

I can see that all existing Attribute2 at dimS table have corresponding rows at fact table.

On the other hand I've got a calculated measure:

CREATE MEMBER CURRENTCUBE.[MEASURES].[MyMeasure]
AS ([Measures].[FactTable - LastValue]
, [DimS].[S Hierarchy].[All].[Hierarchy SomeName]
, [DimS].[Category].[All]
, [DimS].[Question].CurrentMember
, [CimC].[Status].&[Active]
),DISPLAY_FOLDER='Folder',VISIBLE = 1;

and when running below MDX:

SELECT
{ [Measures].[MyMeasure] } ON COLUMNS, 
{ ([Survey].[Attribute2].ALLMEMBERS ) }  ON ROWS 
FROM [MyCube]

I can see that 2 of Attribute2 have no values (null) assigned to them.

What can cause issue like that (DimS and cube has been just processed fully)?

Found the rootcause.

the reference in MDX definition of calculated measure to [DimS].[S Hierarchy].[All].[Hierarchy SomeName] is another calculated measure where actually we have hardcoded values within dimension hierarchy. And for [Attribute2] this condition is not met.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM