dbTalk Databases Forums  

Improving of MDX with NON EMPTY and WHERE whith calculated member

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


Discuss Improving of MDX with NON EMPTY and WHERE whith calculated member in the microsoft.public.sqlserver.olap forum.



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

Default Improving of MDX with NON EMPTY and WHERE whith calculated member - 05-11-2005 , 07:10 AM






Hello,
I have a MDX query like this:

WITH
SET [SelectedStations] As
'{[Station].[5433014],[Station].[5433015],[Station].[5433024],[Station].[5433025],[Station].[5433042]}'
MEMBER [Station].[Permited] as 'Sum([SelectedStations])'
SELECT
NON EMPTY {[Year].[2004].[Days].[all days].children} ON COLUMNS,
NON EMPTY {[Seller].[all seller].children} ON ROWS
FROM
[UPPOK]
WHERE
( [Station].[Permited])

without the where clausule is quick, with where clausule is slow.
Is there some way to improve this?

Some facts:
The number of {[Seller].[all seller].children} is 6000
the number of NON EMPTY {[Seller].[all seller].children} is cca. 30
the number of [Station].members is cca 200

the number of [Year].[2004].[Days].[all days].children is 365
the number of NON EMPTY [Year].[2004].[Days].[all days].children is cca. 20

The set [SelectedStations] is for each query different.

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

Default Re: Improving of MDX with NON EMPTY and WHERE whith calculated member - 05-11-2005 , 01:22 PM






Based on the dimension data you provided, the results are sparse, so
using NonEmptyCrossJoin() may help, like:

Quote:
WITH
SET [SelectedStations] As
'{[Station].[5433014],[Station].[5433015],[Station].[5433024],[Station].
[5433025],[Station].[5433042]}'
MEMBER [Station].[Permited] as 'Sum([SelectedStations])'
SELECT
NonEmptyCrossJoin([Year].[2004].[Days].[all days].children,
[SelectedStations], 1) ON COLUMNS,
NonEmtpyCrossJoin([Seller].[all seller].children,[SelectedStations], 1)
ON ROWS
FROM
[UPPOK]
WHERE
([Station].[Permited])

Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #3  
Old   
Ondrej Srubar
 
Posts: n/a

Default Re: Improving of MDX with NON EMPTY and WHERE whith calculated mem - 05-12-2005 , 09:26 AM



Thank you, it's faster.
But I still have a problem. Time grows exponencialy with regard to size of
[SelectedStations] and problem is in WHERE clausule. Is there a solution?
Ondrej Srubar

"Deepak Puri" wrote:

Quote:
Based on the dimension data you provided, the results are sparse, so
using NonEmptyCrossJoin() may help, like:


WITH
SET [SelectedStations] As
'{[Station].[5433014],[Station].[5433015],[Station].[5433024],[Station].
[5433025],[Station].[5433042]}'
MEMBER [Station].[Permited] as 'Sum([SelectedStations])'
SELECT
NonEmptyCrossJoin([Year].[2004].[Days].[all days].children,
[SelectedStations], 1) ON COLUMNS,
NonEmtpyCrossJoin([Seller].[all seller].children,[SelectedStations], 1)
ON ROWS
FROM
[UPPOK]
WHERE
([Station].[Permited])




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