dbTalk Databases Forums  

Bug in Non Empty Function

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Bug in Non Empty Function in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Raj C.
 
Posts: n/a

Default Bug in Non Empty Function - 07-16-2003 , 04:29 AM






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















Reply With Quote
  #2  
Old   
joerg
 
Posts: n/a

Default Bug in Non Empty Function - 07-16-2003 , 07:05 AM






Hi,
Non Empty is not a function.
It is a keyword.

HTH
Jörg


Quote:
-----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














.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.