![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
-----Original Message----- Hi, We have been using the Non Empty function as a substitute for the Filter..Not IsEmpty function when we want to eliminate empty tuples from our result cube that contain either calculated or duplicate members (otherwise we would simply use the more efficient NonEmptyCrossjoin function). We used the Non Empty function ONLY because it is simpler to write within the context of a Select statement. For example the following 2 MDX queries generate the same result cube with equal efficiency: Non Empty Example: WITH MEMBER [Time].[1997].[Q1_Q2] AS' aggregate({[Time].[1997]. [Q1],[Time].[1997].[Q2]})' SELECT {[Measures].[Unit Sales]} ON COLUMNS, Non Empty(({[Time].[1997],[Time].[1997].[Q1],[Time]. [1997].[Q2],[Time].[1997].[Q3],[Time].[1997].[Q4],[Time]. [1997].[Q1],[Time].[1997].[Q1_Q2]} * {[Customers]. [City].allmembers} * {[Product].[Product Department].allmembers})) ON ROWS FROM [Sales] Filter...Not IsEmpty Example: WITH MEMBER [Time].[1997].[Q1_Q2] AS' aggregate({[Time].[1997]. [Q1],[Time].[1997].[Q2]})' SELECT {[Measures].[Unit Sales]} ON COLUMNS, Filter(({[Time].[1997],[Time].[1997].[Q1],[Time].[1997]. [Q2],[Time].[1997].[Q3],[Time].[1997].[Q4],[Time].[1997]. [Q1],[Time].[1997].[Q1_Q2]} * {[Customers]. [City].allmembers} * {[Product].[Product Department].allmembers}), not isempty (([Time].currentmember,[Customers].currentmember, [Product].currentmember))) ON ROWS FROM [Sales] Again because of the relative simplicity of the first example, we have chosen to use the Non Empty function. However, we believe we have found a bug in MDX. When we attempt to Hierarchize the Non Empty example we generate an error: WITH MEMBER [Time].[1997].[Q1_Q2] AS' aggregate({[Time].[1997]. [Q1],[Time].[1997].[Q2]})' SELECT {[Measures].[Unit Sales]} ON COLUMNS, Hierarchize(Non Empty(({[Time].[1997],[Time].[1997].[Q1], [Time].[1997].[Q2],[Time].[1997].[Q3],[Time].[1997].[Q4], [Time].[1997].[Q1],[Time].[1997].[Q1_Q2]} * {[Customers]. [City].allmembers} * {[Product].[Product Department].allmembers}))) ON ROWS FROM [Sales] Yet when we attempt to generate the same result using the more complex Filter...Not IsEmpty, the query works: WITH MEMBER [Time].[1997].[Q1_Q2] AS' aggregate({[Time].[1997]. [Q1],[Time].[1997].[Q2]})' SELECT {[Measures].[Unit Sales]} ON COLUMNS, Hierarchize(Filter(({[Time].[1997],[Time].[1997].[Q1], [Time].[1997].[Q2],[Time].[1997].[Q3],[Time].[1997].[Q4], [Time].[1997].[Q1],[Time].[1997].[Q1_Q2]} * {[Customers]. [City].allmembers} * {[Product].[Product Department].allmembers}), not isempty (([Time].currentmember,[Customers].currentmember, [Product].currentmember)))) ON ROWS FROM [Sales] CAN ANYBODY EXPLAIN THIS MOST UNUSUAL BEHAVIOR IN THE NON EMPTY FUNCTION? Any help would be greatly appreciated. Thanks, Raj C. raj_chinna3 (AT) hotmail (DOT) com . |
![]() |
| Thread Tools | |
| Display Modes | |
| |