dbTalk Databases Forums  

Help w/ multiple conditions on same hierarchy

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


Discuss Help w/ multiple conditions on same hierarchy in the microsoft.public.sqlserver.olap forum.



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

Default Help w/ multiple conditions on same hierarchy - 11-09-2005 , 02:47 PM






Hi,

I need to specify two conditions from the same hierarchy and am running
into problems. As an example, how could I create a query (from the
Foodmart DB) that shows total USA Warehouse Sales , but excludes the
Los Angeles Stores? In addition, I need my results to be at the Country
level. The problem I can't seem to overcome is filtering on both the
Country AND the city. Any help would be much appreciated.

Thanks,

Bill Adams


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

Default Re: Help w/ multiple conditions on same hierarchy - 11-09-2005 , 07:08 PM






How about using VisualTotals, like for Foodmart scenario:

Quote:
select {[Measures].[Warehouse Sales]} on columns,
Head(VisualTotals(Hierarchize(Except(Descendants(
[Store].[All Stores].[USA], [Store].[Store City], SELF_AND_BEFORE),
{[Store].[All Stores].[USA].[CA].[Los Angeles]})))) on rows
from Warehouse
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


Reply With Quote
  #3  
Old   
Bill Adams
 
Posts: n/a

Default Re: Help w/ multiple conditions on same hierarchy - 11-09-2005 , 07:55 PM



I have never used VisualTotals, so I will study your example and give
it a try.
Thanks for the excellent example and the quick response !

Bill


Reply With Quote
  #4  
Old   
Bill Adams
 
Posts: n/a

Default Re: Help w/ multiple conditions on same hierarchy - 11-11-2005 , 08:17 AM



Deepak,

Just wanted to let you know your example worked flawlessly and was
exactly what I needed. Thanks again!

Bill


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.