dbTalk Databases Forums  

Filter function for lower level members

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


Discuss Filter function for lower level members in the microsoft.public.sqlserver.olap forum.



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

Default Filter function for lower level members - 07-28-2005 , 09:50 PM






I have a dimension with two levels, and I want to return a set of the
top members, but filtered against a measure at the lower level.

So I want to check each SKU cost to see if it is greater than $100, and
if even a single SKU meets this criteria, the set includes that
category.

Example: Product Dimension: Categories Level --> SKU Level

FILTER([Product].[Categories].Members,
([Product].[SKU],[Measures].[Cost] > $100))
(This doesn't work)

Any help appreciated. Thanks


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

Default Re: Filter function for lower level members - 07-28-2005 , 10:39 PM






You can check if the count of such descendants is > 0:

Quote:
FILTER([Product].[Categories].Members,
Count(Filter(Descendants(
[Product].CurrentMember, [Product].[SKU]),
[Measures].[Cost] > $100)) > 0)
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.