Not that you can use the NECJ() version of the MDX query in Excel, but
how long does that take to execute, by way of comparison? That would
give an idea of the gap.
Earlier discussions in the newsgroup suggest that there is a threshold
of cross-join set size, above which a faster algorithm for finding
non-empty tuples is used. This can be controlled in the connection
string:
http://groups.google.com/groups?q=no...hl=en&lr=&ie=U
tf-8&oe=utf-8&selm=eocezqilcha.4128%40tkmsftngp08&rnum=7
Quote:
|
From: Chris Webb [MS] (chwebb (AT) online (DOT) microsoft.com)
|
Subject: Re: NON_EMPTY_BEHAVIOUR calc member option
View: Complete Thread (6 articles)
Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2002-11-25 05:24:12 PST
This is my understanding of how it all works:
Analysis Services it uses to remove empty cells: the 'old' one, which is
slow but 100% reliable, and the 'new' one (as used in NONEMPTYCROSSJOIN)
which is faster but can only be used when there are no calculated
members,
custom rollups etc in the query. To allow Analysis Services to use the
second algorithm more often, and therefore make queries faster, you can
use
the NON_EMPTY_BEHAVIOR property to say that a calculated measure will be
null whenever a given base measure is null. However, this does not
guarantee
that the second algorithm will be used! Analysis Services will still
sometimes use the old algorithm in certain cases.
Take the following example:
WITH MEMBER MEASURES.DEMO AS 'IIF(MEASURES.[UNIT SALES]>25000, 1,
NULL)',
NON_EMPTY_BEHAVIOR='[MEASURES].[UNIT SALES]'
SELECT
{MEASURES.[DEMO]}
ON 0,
NON EMPTY
CROSSJOIN(
[Product].[Product Family].MEMBERS, GENDER.GENDER.MEMBERS) ON 1
FROM SALES
You would expect it to simply assume that since Unit Sales is not null
for
this set of tuples, Measures.Demo will not be null (even though this is
not
actually true), and so in turn empty cells should appear despite the NON
EMPTY clause. However, if you run it on Foodmart 2000, you'll see that
even
though I've lied about the NON_EMPTY_BEHAVIOR of this calculated
measure,
Analysis Services hasn't believed me and has still filtered out the
empty
cells.
The key to getting it to believe my lie is the NON EMPTY THRESHOLD
connection string property (default value=5000). This is the lower
threshold
for the number of tuples(?) that must be evaluated for Analysis Services
to
decide that it is worth the effort of using the new algorithm; in the
above
example it's still using the old algorithm because the query is so
small.
So, if you rerun the above query with NON EMPTY THRESHOLD=1 then you'll
see
that the result set has changed, and it has now believed my lie: empty
cells
appear in the result set. The same thing happens with values up to 5,
but as
soon as you use NON EMPTY THRESHOLD=6 you'll see that it has gone back
to
the old algorithm and empty tuples are filtered again.
NB as with all this semi-documented stuff, it should be used at your own
risk.
...
- Deepak
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!