dbTalk Databases Forums  

MDX problem - NonEmpty makes results go away

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


Discuss MDX problem - NonEmpty makes results go away in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ChrisHarrington
 
Posts: n/a

Default MDX problem - NonEmpty makes results go away - 09-06-2006 , 08:56 AM






The following is a subset of an MDX expression I am struggling with.

WITH
MEMBER [Employee].[Employee Department].[Total]
AS '[Employee].[Employee Department].[Department Name].&[Sales]'
MEMBER [Product].[Product Model Categories].[Total]
AS '[Product].[Product Model Categories].[Category].&[1]'

SET [Dicer Filtered Set]
AS '{Descendants ([Employee].[Employee Department].[Department
Name].&[Sales],[Employee].[Employee Department].[Title],SELF)}'
SET [Crossjoin Filtered Set]
AS '{Descendants([Product].[Product Model
Categories].[Category].&[1],[Product].[Product Model
Categories].[Subcategory],SELF)}'

SELECT
{
[Measures].[Reseller Sales Amount]
}

ON COLUMNS,
{
CrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model Categories].[Total]}
)
}
ON ROWS
FROM [Channel Sales]


What I really want is

....
NonemptyCrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model Categories].[Total]}
....

But when so modifed, the query does not return the subtotal rows.


--------------------
Chris Harrington
Active Interface, Inc.
http://www.activeinterface.com



Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: MDX problem - NonEmpty makes results go away - 09-06-2006 , 06:39 PM






NonEmptyCrossjoin is a depreciated function in AS 2005 because it does
strange things like this.

Try using the NonEmpty() function, it should do the trick.

NonEmpty(CrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model
Categories].[Total]}))

--
Regards
Darren Gosbell [MVP]
Blog: http://geekswithblogs.net/darrengosbell

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #3  
Old   
ChrisHarrington
 
Posts: n/a

Default Re: MDX problem - NonEmpty makes results go away - 09-06-2006 , 09:28 PM



Thanks Darren,

I had found (after posting) that NonEmpty(CrossJoin()) worked - but was not
sure if this was the best approach.

Chris

"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote

Quote:
NonEmptyCrossjoin is a depreciated function in AS 2005 because it does
strange things like this.

Try using the NonEmpty() function, it should do the trick.

NonEmpty(CrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model
Categories].[Total]}))

--
Regards
Darren Gosbell [MVP]
Blog: http://geekswithblogs.net/darrengosbell

*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
  #4  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: MDX problem - NonEmpty makes results go away - 09-08-2006 , 07:57 AM



The NonEmpty() function is definitely the way to go in AS2k5, it is the
most reliable way of filtering out empty cells and is relatively fast.

As I said before NonEmptyCrossjoin has been depreciated in AS2k5 (it is
still there, but it not recommended). There are also some rare
circumstances when the NON EMPTY function on the axis does not produce
correct results. I blogged about this here
http://geekswithblogs.net/darrengosb.../17/75357.aspx

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <#NIzDVi0GHA.4796 (AT) TK2MSFTNGP03 (DOT) phx.gbl>, "ChrisHarrington"
<charrington-at-activeinterface.com> says...
Quote:
Thanks Darren,

I had found (after posting) that NonEmpty(CrossJoin()) worked - but was not
sure if this was the best approach.

Chris

"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message
news:OIpYz2g0GHA.3464 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
NonEmptyCrossjoin is a depreciated function in AS 2005 because it does
strange things like this.

Try using the NonEmpty() function, it should do the trick.

NonEmpty(CrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model
Categories].[Total]}))

--
Regards
Darren Gosbell [MVP]
Blog: http://geekswithblogs.net/darrengosbell

*** Sent via Developersdex http://www.developersdex.com ***




Reply With Quote
  #5  
Old   
SAM
 
Posts: n/a

Default Re: MDX problem - NonEmpty makes results go away - 09-08-2006 , 09:34 AM



Is this possible in AS2000?

"Darren Gosbell" wrote:

Quote:
The NonEmpty() function is definitely the way to go in AS2k5, it is the
most reliable way of filtering out empty cells and is relatively fast.

As I said before NonEmptyCrossjoin has been depreciated in AS2k5 (it is
still there, but it not recommended). There are also some rare
circumstances when the NON EMPTY function on the axis does not produce
correct results. I blogged about this here
http://geekswithblogs.net/darrengosb.../17/75357.aspx

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <#NIzDVi0GHA.4796 (AT) TK2MSFTNGP03 (DOT) phx.gbl>, "ChrisHarrington"
charrington-at-activeinterface.com> says...
Thanks Darren,

I had found (after posting) that NonEmpty(CrossJoin()) worked - but was not
sure if this was the best approach.

Chris

"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message
news:OIpYz2g0GHA.3464 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
NonEmptyCrossjoin is a depreciated function in AS 2005 because it does
strange things like this.

Try using the NonEmpty() function, it should do the trick.

NonEmpty(CrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model
Categories].[Total]}))

--
Regards
Darren Gosbell [MVP]
Blog: http://geekswithblogs.net/darrengosbell

*** Sent via Developersdex http://www.developersdex.com ***





Reply With Quote
  #6  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: MDX problem - NonEmpty makes results go away - 09-09-2006 , 06:50 AM



No, the NonEmpty() function was only introduced with AS 2005.

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <9CA483BD-CDA8-4D9E-B756-A0F52B39A298 (AT) microsoft (DOT) com>,
SAM (AT) discussions (DOT) microsoft.com says...
Quote:
Is this possible in AS2000?

"Darren Gosbell" wrote:

The NonEmpty() function is definitely the way to go in AS2k5, it is the
most reliable way of filtering out empty cells and is relatively fast.

As I said before NonEmptyCrossjoin has been depreciated in AS2k5 (it is
still there, but it not recommended). There are also some rare
circumstances when the NON EMPTY function on the axis does not produce
correct results. I blogged about this here
http://geekswithblogs.net/darrengosb.../17/75357.aspx

--
Regards
Darren Gosbell - SQL Server MVP
Blog: http://www.geekswithblogs.net/darrengosbell

In article <#NIzDVi0GHA.4796 (AT) TK2MSFTNGP03 (DOT) phx.gbl>, "ChrisHarrington"
charrington-at-activeinterface.com> says...
Thanks Darren,

I had found (after posting) that NonEmpty(CrossJoin()) worked - but was not
sure if this was the best approach.

Chris

"Darren Gosbell" <jam (AT) newsgroups (DOT) nospam> wrote in message
news:OIpYz2g0GHA.3464 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
NonEmptyCrossjoin is a depreciated function in AS 2005 because it does
strange things like this.

Try using the NonEmpty() function, it should do the trick.

NonEmpty(CrossJoin(
{[Dicer Filtered Set]},
{[Crossjoin Filtered Set],[Product].[Product Model
Categories].[Total]}))

--
Regards
Darren Gosbell [MVP]
Blog: http://geekswithblogs.net/darrengosbell

*** Sent via Developersdex http://www.developersdex.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.