May 2, 2009 at 12:56 pm
I am trying to filter out some tuples in an mdx query and I can't figure out an easy way to do it.
e.g.
select
{} on 0,
[Product].[Product Categories] on 1
from [adventure works]
WHERE not [Product].[Product Categories].[Gloves]
or
select
{} on 0,
Filter([Product].[Product Categories],[Product].[Product Categories] <> [Gloves]) on 1
from [adventure works]
I know the above is not syntatically correct, just trying to explain what I am trying to acheive.
Also, I don't have AW on this computer, so sorry if I'm mixing dimensions.
I'm new to MDX...
Any help is appreciated.
Thanks, Megan
May 3, 2009 at 4:10 am
You can look at utilizing the Except (MDX) function. It will look like this:
select
{} on 0,
Except([Product].[Product Categories].members,
{[Product].[Product Categories].[Gloves]}) on 1
from [adventure works]
----------------------------------------------------------------------------------------
Dan English - http://denglishbi.wordpress.com
May 3, 2009 at 10:19 am
OMG! I glanced right over that function. THANK YOU.
-M
May 3, 2009 at 7:49 pm
You can also use this syntax - (Except) (MDX).
Which would look like this from BOL:
// This query shows the quantity of orders for all product categories
// with the exception of Components.
SELECT
[Measures].[Order Quantity] ON COLUMNS,
[Product].[Product Categories].[All].Children
- [Product].[Product Categories].[Components] ON ROWS
FROM
[Adventure Works]
----------------------------------------------------------------------------------------
Dan English - http://denglishbi.wordpress.com
May 4, 2009 at 9:12 am
cool! thanks!
July 16, 2025 at 1:34 pm
Hi Megan! To exclude Gloves, you'd typically remove that member from the set using a function like Except. You're thinking in the right direction—filtering out items you don’t need helps focus your analysis, and in this case, leaving out Gloves makes sense if they're not relevant to what you're reviewing.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply