dbTalk Databases Forums  

Filtering on lower level

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


Discuss Filtering on lower level in the microsoft.public.sqlserver.olap forum.



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

Default Filtering on lower level - 07-01-2004 , 05:21 PM






I have a dimension hirearchy of 4 level, I want filter on a certain value of
a measure at lowest level and display only the parent level that satisfy
the filtering rule.
By Ex:

- Dimension Customer

Country
State Province
City
Name

Measure Unit Sales at level "name" in a certain time (1997) > 300

Espected result is:

USA (the real total of all level including member that do not fit with
filter)
- WA (the real total)
-- Seattle (the real total)
--- Allchin 300
--- Jim 320
- OR
-- City xxx
--- Name yyy 400

Any hints?
--
Ermanno

Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default RE: Filtering on lower level - 07-02-2004 , 08:31 AM






How about this?

select
{[Measures].[Unit Sales]} on columns,
hierarchize(generate( filter([Customers].[Name].members,([Unit Sales],[1997])>300) , ascendants(customers.currentmember)) ) on rows
from Sales
where [1997]

HTH,
--
Brian
www.geocities.com/brianaltmann/olap.html


"Ermanno Bonifazi" wrote:

Quote:
I have a dimension hirearchy of 4 level, I want filter on a certain value of
a measure at lowest level and display only the parent level that satisfy
the filtering rule.
By Ex:

- Dimension Customer

Country
State Province
City
Name

Measure Unit Sales at level "name" in a certain time (1997) > 300

Espected result is:

USA (the real total of all level including member that do not fit with
filter)
- WA (the real total)
-- Seattle (the real total)
--- Allchin 300
--- Jim 320
- OR
-- City xxx
--- Name yyy 400

Any hints?
--
Ermanno


Reply With Quote
  #3  
Old   
Ermanno Bonifazi
 
Posts: n/a

Default Re: Filtering on lower level - 07-02-2004 , 06:27 PM



It works.

I 've found this solution too.

with set [Name > 400] AS 'Distinct(filter(descendants( [customers].members,
[customers].[name]), [Measures].[Unit Sales] > 300))'

select
{[Measures].[Unit Sales]} on columns,
Hierarchize({generate([Name > 400], Ancestors([Customers].currentmember,
2)), generate([Name > 400], Ancestors([Customers].currentmember, 1)), [Name
Quote:
400]} )on rows
from Sales

"Brian Altmann" <findme@thesignaturewebsite> wrote

Quote:
How about this?

select
{[Measures].[Unit Sales]} on columns,
hierarchize(generate( filter([Customers].[Name].members,([Unit
Sales],[1997])>300) , ascendants(customers.currentmember)) ) on rows
from Sales
where [1997]

HTH,
--
Brian
www.geocities.com/brianaltmann/olap.html


"Ermanno Bonifazi" wrote:

I have a dimension hirearchy of 4 level, I want filter on a certain
value of
a measure at lowest level and display only the parent level that satisfy
the filtering rule.
By Ex:

- Dimension Customer

Country
State Province
City
Name

Measure Unit Sales at level "name" in a certain time (1997) > 300

Espected result is:

USA (the real total of all level including member that do not fit with
filter)
- WA (the real total)
-- Seattle (the real total)
--- Allchin 300
--- Jim 320
- OR
-- City xxx
--- Name yyy 400

Any hints?
--
Ermanno




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.