user2564512
user2564512

Reputation:

MDX Query behaving abrupt with degenerate dimension on CDE dashboard

Following is my query:

WITH
    SET [sp] AS
        ([time.fin].[day].[${parDate}]:[time.fin].[day].[${partoDate}])

SET [factory] AS
    {[organization].[org].[Fact1],[organization].[org].[Fact2],[organization].[org].[Fact3]}

MEMBER [btype].[b] AS
     AGGREGATE(IIF('${param}'='All',
                    [btype].[type].members,
                     [btype].[type].[${param}]
        ))    

SELECT
NON EMPTY {[factory]} ON COLUMNS,
NON EMPTY {[sp]}ON ROWS
FROM [cube1]
WHERE ([btype].[b], [Measures].[qty])

in this , btype is the degenerate dimension. When i execute this query on CDE .. sometimes I get java.lang.nullpointerexception , the behaviour is very random. Often, it gives the result and for default load , it always results positive . But for date range change , I randomly get the exception.

my fact_table structure has 5 normal dimension and 3 degenerates .

meanwhile, I have also observed that if add some more grain to the query , then the exception doesn't appear anymore. But adding that doesn't fullfill my required result.

Is it something to do with degenerate dimension concept or high cardinality issue

Upvotes: 0

Views: 134

Answers (1)

whytheq
whytheq

Reputation: 35567

Maybe this measure needs to be more explicit:

MEMBER [btype].[b] AS
     AGGREGATE(IIF('${param}'='All',
                    [btype].[type].members,
                     [btype].[type].[${param}]
        ))  

If you change it to the following do you encounter the error?

MEMBER [btype].[b] AS 
    Sum
    (
      IIF
      (
        '${param}' = 'All'
       ,[btype].[type].MEMBERS
       ,[btype].[type].[${param}]
      )
    ,[Measures].[qty]
    )

Upvotes: 0

Related Questions