dbTalk Databases Forums  

Except in MDX

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


Discuss Except in MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Angie via SQLMonster.com
 
Posts: n/a

Default Except in MDX - 07-13-2005 , 05:42 AM






The product dimension has several categories A, B, C, D etc.
For a specific report, the user needs to be given the option of 2 categories
A and others. The others have to include all categories that are != A

When I try the below i get the required results.
select except([Product].[Category].[All].Children,
{[Product].[Category].[A]})'
select [Product].[test]
on columns
from [cube1]

But when I try to convert the above into a calc member on the product
dimension, I get an error. with member [Product].[test]
as 'except([Product].[Category].[All].Children,
{[Product].[Category].[A]})'
select [Product].[test]
on columns
from [cube1]

How can I provide this facility to the user? How can the calc member be made
available to the user? When I try to use this member in a Pivot front end, I
am not able to drag it to the data area.

Thanks very much


--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...-olap/200507/1

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

Default Re: Except in MDX - 07-13-2005 , 06:54 PM






Since Except() returns a set, not a value, it would typically be
processsed with Aggregate() ot Sum(), like:

Quote:
with member [Product].[test] as
'Aggregate(except([Product].[Category].[All].Children,
{[Product].[Category].[A]})'
Quote:
To make it available in an Excel Pivot Table, the calculated member can
be defined on the cube server.


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