dbTalk Databases Forums  

Filter results in MDX to subset of years

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


Discuss Filter results in MDX to subset of years in the microsoft.public.sqlserver.olap forum.



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

Default Filter results in MDX to subset of years - 05-12-2004 , 05:01 PM






I have an MDX query to return healthcare costs
select NON EMPTY { [Measures].[Submitted Amount] : [Measures].[Benefits Not Covered]} on columns
{[Group].[Main Group].Members} on row
from ClaimsI

1) How do I have this only return results for a set of years (2002, 2003) instead of all the years in the cube
2) How would I apply a CrossJoin to show only these years as subordinates to each member

Thank you in advance.

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

Default RE: Filter results in MDX to subset of years - 05-13-2004 , 07:31 AM






You can add the set of years

select NON EMPTY
{ { [Measures].[Submitted Amount] : [Measures].[Benefits Not Covered]} * {[Time].[2002],[Time].[2003]} } on columns
{[Group].[Main Group].Members} on row
from ClaimsI

BTW, * is an alternate Crossjoin syntax. If you need to return a long period of consecutive years you can use the range expression : [Time].[1998]:[Time].[2005] to avoid enumerating the intermediate members
HTH
Bria
www.geocities.com/brianaltmann/olap.html

Reply With Quote
  #3  
Old   
anup
 
Posts: n/a

Default Re: Filter results in MDX to subset of years - 05-21-2004 , 04:41 AM



Could you elaborate a little on how you implemented this query; assuming
that the year value can change in the query, how did you pass parameters to
the mdx query

thanks, much
-Anup

"Brian Altmann" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
You can add the set of years:

select NON EMPTY
{ { [Measures].[Submitted Amount] : [Measures].[Benefits Not Covered]} *
{[Time].[2002],[Time].[2003]} } on columns,
{[Group].[Main Group].Members} on rows
from ClaimsII

BTW, * is an alternate Crossjoin syntax. If you need to return a long
period of consecutive years you can use the range expression :
[Time].[1998]:[Time].[2005] to avoid enumerating the intermediate members.
Quote:
HTH,
Brian
www.geocities.com/brianaltmann/olap.html



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.