dbTalk Databases Forums  

#Err returned by Count( ,EXLUDEEMPTY)

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


Discuss #Err returned by Count( ,EXLUDEEMPTY) in the microsoft.public.sqlserver.olap forum.



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

Default #Err returned by Count( ,EXLUDEEMPTY) - 12-05-2005 , 06:32 AM






When I run the following query against the Foodmart database, the
result rowset contains #Err values. But if I change EXCLUDEEMPTY to
INCLUDEEMPTY, the correct value os returned.

Does anyone have any ideas?

Leroy.

WITH MEMBER [Measures].[No Locations]
As
'
COUNT ( [Warehouse].[City].members , EXCLUDEEMPTY )
'

SELECT

{ [Measures].[No Locations] } ON COLUMNS,
{ [Product].[Product Family].members } ON ROWS
FROM [Warehouse]


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

Default Re: #Err returned by Count( ,EXLUDEEMPTY) - 12-05-2005 , 11:04 PM






If you double-click the #ERR cells in MDX Sample App, the error message
identifies infinte recursion. This is because,
with EXCLUDEEMPTY, a measure is tested to see if it is empty. But
because Count() is used in a calculated measure, that measure becomes
the default measure, unless another measure is explicitly specified.

So try this version of EXCLUDEEMPTY instead:

Quote:
WITH MEMBER [Measures].[No Locations] As
'COUNT ( [Warehouse].[City].members
* { [Measures].[Units Ordered]}, EXCLUDEEMPTY )'

SELECT
{ [Measures].[No Locations] } ON COLUMNS,
{ [Product].[Product Family].members } ON ROWS
FROM [Warehouse]
Quote:

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