dbTalk Databases Forums  

Non Empty Problem

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


Discuss Non Empty Problem in the microsoft.public.sqlserver.olap forum.



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

Default Non Empty Problem - 12-28-2005 , 12:51 AM






Hi Every One,
When I am runing query using Non Empty to filter null rows, the resultset
the server returns, returns all the rows including the null ones and then the
client computer does the filltering on the null rows and not the server. The
result is that a query that should return only 100 rows with no null return
2,000,000 with null and it takes the client a long time to filter the nulls
and give me the final result. It happens by using Ado with vb.net or by using
the MDX sample application. It also happens by openning connection string
with execution location=3 (server side).
Have any idea how to solve it?
Thanks,
Ruby

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Non Empty Problem - 12-28-2005 , 09:32 AM






Hi Ruby,

Can you describe the dimensions and MDX query that generate the 2
million rows - is it multiple cross-joins? Also, does it involve
calculated measures, in which case this MS KB article may help:

http://support.microsoft.com/default...b;en-us;304137
Quote:
INF: How to Increase the Speed of MDX Queries that Contain the NON EMPTY
Keyword

Article ID : 304137
Last Review : July 15, 2004
Revision : 1.1
This article was previously published under Q304137

SUMMARY
In some cases, a query slows down considerably when you use both the NON
EMPTY keyword on an axis of a Multidimensional Expression together with
a calculated member.

This article describes how you can optimize a query, by using the Non
Empty Behavior property for the calculated member.
...
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #3  
Old   
Ruby Nadler
 
Posts: n/a

Default Re: Non Empty Problem - 01-02-2006 , 02:38 AM



HI Deepak Puri,
thanks for answering (and not for the first time).
the query has a crossjoin between 2 dimensions with about 200,000 members
each.it also has calculated measures as you thought correctly.

"Deepak Puri" wrote:

Quote:
Hi Ruby,

Can you describe the dimensions and MDX query that generate the 2
million rows - is it multiple cross-joins? Also, does it involve
calculated measures, in which case this MS KB article may help:

http://support.microsoft.com/default...b;en-us;304137

INF: How to Increase the Speed of MDX Queries that Contain the NON EMPTY
Keyword

Article ID : 304137
Last Review : July 15, 2004
Revision : 1.1
This article was previously published under Q304137

SUMMARY
In some cases, a query slows down considerably when you use both the NON
EMPTY keyword on an axis of a Multidimensional Expression together with
a calculated member.

This article describes how you can optimize a query, by using the Non
Empty Behavior property for the calculated member.
...



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #4  
Old   
Ruby Nadler
 
Posts: n/a

Default Re: Non Empty Problem - 01-02-2006 , 04:34 AM



Hi Again,
i read the article but it says what to do on the members if they are
already created by the time i run the query. what should i do when i build
the member inside the mdq query?
this is my query:
WITH
MEMBER
[Company].Selection
As
' sum ( {[Company].[All Company].[Microsoft],[Company].[All
Company].[Apple] } ) '
MEMBER
[Date].DateRange
As
' sum ( {[Date].[All Date].[2005].[1].[1].[1]:[Date].[All
Date].[2005].[4].[12].[1] } ) '
MEMBER
[Sector].SectorOp
As
' sum ( { [Sector].[All Sector].[English],[Sector].[All Sector].[Spanish] }
) '
SELECT
Non Empty {[Measures].allmembers } ON COLUMNS,
Non Empty {CrossJoin
({[program].[operatortype].Members},{[Product].[product].Members})} on rows
FROM
[ADV_SMALL]
WHERE
( [Date].DateRange,[Sector].SectorOp, [Company].Selection )
thanks

"Deepak Puri" wrote:

Quote:
Hi Ruby,

Can you describe the dimensions and MDX query that generate the 2
million rows - is it multiple cross-joins? Also, does it involve
calculated measures, in which case this MS KB article may help:

http://support.microsoft.com/default...b;en-us;304137

INF: How to Increase the Speed of MDX Queries that Contain the NON EMPTY
Keyword

Article ID : 304137
Last Review : July 15, 2004
Revision : 1.1
This article was previously published under Q304137

SUMMARY
In some cases, a query slows down considerably when you use both the NON
EMPTY keyword on an axis of a Multidimensional Expression together with
a calculated member.

This article describes how you can optimize a query, by using the Non
Empty Behavior property for the calculated member.
...



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #5  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Non Empty Problem - 01-04-2006 , 08:20 PM



Unfortunately, since the calculated members are not measures, the Non
Empty Behavior property won't help here. There may be other options with
AS 2005, but below is an approach for AS 2000 (assuming that all
Measures are empty for cells with no underlying fact data):

Quote:
WITH
Set [CompanySet] as
'{[Company].[All Company].[Microsoft],
[Company].[All Company].[Apple]}'
MEMBER [Company].Selection as
'Sum([CompanySet])'
Set [DateSet] as
'{[Date].[All Date].[2005].[1].[1].[1]:
[Date].[All Date].[2005].[4].[12].[1]}'
MEMBER [Date].DateRange as
'Sum([DateSet])'
Set [SectorSet] as
'{[Sector].[All Sector].[English],
[Sector].[All Sector].[Spanish]}'
MEMBER [Sector].SectorOp as
'Sum([SectorSet])'
SELECT
Non Empty [Measures].allmembers ON COLUMNS,
NonEmptyCrossJoin(
[program].[operatortype].Members,
[Product].[product].Members,
[CompanySet], [DateSet],
[SectorSet], 2) on rows
FROM [ADV_SMALL]
WHERE ([Date].DateRange, [Sector].SectorOp, [Company].Selection)
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #6  
Old   
Ruby Nadler
 
Posts: n/a

Default Re: Non Empty Problem - 01-08-2006 , 07:33 AM



THANKS, I will try it.

"Deepak Puri" wrote:

Quote:
Unfortunately, since the calculated members are not measures, the Non
Empty Behavior property won't help here. There may be other options with
AS 2005, but below is an approach for AS 2000 (assuming that all
Measures are empty for cells with no underlying fact data):


WITH
Set [CompanySet] as
'{[Company].[All Company].[Microsoft],
[Company].[All Company].[Apple]}'
MEMBER [Company].Selection as
'Sum([CompanySet])'
Set [DateSet] as
'{[Date].[All Date].[2005].[1].[1].[1]:
[Date].[All Date].[2005].[4].[12].[1]}'
MEMBER [Date].DateRange as
'Sum([DateSet])'
Set [SectorSet] as
'{[Sector].[All Sector].[English],
[Sector].[All Sector].[Spanish]}'
MEMBER [Sector].SectorOp as
'Sum([SectorSet])'
SELECT
Non Empty [Measures].allmembers ON COLUMNS,
NonEmptyCrossJoin(
[program].[operatortype].Members,
[Product].[product].Members,
[CompanySet], [DateSet],
[SectorSet], 2) on rows
FROM [ADV_SMALL]
WHERE ([Date].DateRange, [Sector].SectorOp, [Company].Selection)



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #7  
Old   
Ruby Nadler
 
Posts: n/a

Default Re: Non Empty Problem - 01-08-2006 , 10:14 PM



hI Deepak Puri'
It works fine. Thanks again. can you explain me the difference between the
to queries: yours and mine, and must i use the set or can i use the mwmbwrs
as i used?
Ruby

"Deepak Puri" wrote:

Quote:
Unfortunately, since the calculated members are not measures, the Non
Empty Behavior property won't help here. There may be other options with
AS 2005, but below is an approach for AS 2000 (assuming that all
Measures are empty for cells with no underlying fact data):


WITH
Set [CompanySet] as
'{[Company].[All Company].[Microsoft],
[Company].[All Company].[Apple]}'
MEMBER [Company].Selection as
'Sum([CompanySet])'
Set [DateSet] as
'{[Date].[All Date].[2005].[1].[1].[1]:
[Date].[All Date].[2005].[4].[12].[1]}'
MEMBER [Date].DateRange as
'Sum([DateSet])'
Set [SectorSet] as
'{[Sector].[All Sector].[English],
[Sector].[All Sector].[Spanish]}'
MEMBER [Sector].SectorOp as
'Sum([SectorSet])'
SELECT
Non Empty [Measures].allmembers ON COLUMNS,
NonEmptyCrossJoin(
[program].[operatortype].Members,
[Product].[product].Members,
[CompanySet], [DateSet],
[SectorSet], 2) on rows
FROM [ADV_SMALL]
WHERE ([Date].DateRange, [Sector].SectorOp, [Company].Selection)



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** 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.