Solved

Using the EXCLUDEEMPTY  in mdx count returns Error

Posted on 2012-03-23
2
958 Views
Last Modified: 2012-04-12
Hi All

I am new to MDX so please excuse the ignorance :)   I have create the following MDX statment:

with 
member [measures].[count of existing records] as Count({[Location].[Code].MEMBERS}, EXCLUDEEMPTY)
member [measures].[Stk Qty] as sum([Measures].[Quantity - Stock])

select	{[measures].[count of existing records],
		[measures].[Stk Qty]} 
		on 0,
		[Item].[Item].&[393855 - Candlelight Soft Trousers]
		on 1
from [Retail]' 

Open in new window


However I get a #Error on my [count of existing measures] when I use the EXCLUDEEMPTY option on my count.  When I remove it I get a count, however it is of all locations.

Any help would be massively appreciated.

Cheers

Jon
0
Comment
Question by:McSsporran
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 500 total points
ID: 37762553
Hi Jon,

I suspect you're getting an infinite recursion error, as described here : http://msdn.microsoft.com/en-us/library/aa937471%28v=sql.80%29.aspx

Changing your Count measure to:

Count([Location].[Code].MEMBERS * {[Measures].DefaultMember]},  EXCLUDEEMPTY)

Open in new window


Should resolve the problem.

Also note that if the default aggregation on [Measures].[Quantity - Stock] is SUM (which it probably is - check your measure definition in your cube to determine this) then you don't need to define a measure to sum these values - this will be done for you by MDX.

So your full query should be:

with 
member [measures].[count of existing records] as Count([Location].[Code].MEMBERS * {[Measures].DefaultMember]}, EXCLUDEEMPTY)

select	{[measures].[count of existing records],
		[Measures].[Quantity - Stock]} 
		on 0,
		[Item].[Item].&[393855 - Candlelight Soft Trousers]
		on 1
from [Retail]

Open in new window


Tim
0
 

Author Closing Comment

by:McSsporran
ID: 37837970
Tim<br /><br />Thanks very much that worked a treat.<br /><br />Regards<br /><br />Jon
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question