dbTalk Databases Forums  

MDX Filter Help or atleast comment

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


Discuss MDX Filter Help or atleast comment in the microsoft.public.sqlserver.olap forum.



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

Default MDX Filter Help or atleast comment - 08-01-2003 , 09:56 AM







Hi guys,
I am new to MDX, well what I am trying to do is get those Product.Teams
whose Measure.Sales is greater then 110000000 in the Time.year.2002 in
every Market.country.Pakistan.MEMBERS, (i.e Regions) I hope u guyz
better understand by this way

SELECT { CrossJoin({Market.Country.[Pakistan].CHILDREN},
CrossJoin({Measures.[Sales]},{Time.Year.[2002]}))} ON COLUMNS,
{
Filter({Product.Team.MEMBERS}, (((Time.Year.[2002],Measures.Sales,
Market.country.Pakistan.Central) > 110000000) And
(Market.country.Pakistan.North,Time.Year.[2002],Measures.Sales) >
110000000)
And ((Time.Year.[2002],Measures.Sales, Market.country.Pakistan.South) >
110000000))
} ON ROWS FROM [Sales]

I wrote this MDX successfuly, the problem is the search condition where
I can't use the MEMBER keyword, and I have to write explicitly every
MEMBER of the region level of Market dimension with the whole condition
again and again with the AND operator; like I wrote
(((Time.Year.[2002],Measures.Sales, Market.country.Pakistan.Central) >
110000000) And
(Market.country.Pakistan.North,Time.Year.[2002],Measures.Sales) >
110000000)

I know I can't use
(((Time.Year.[2002],Measures.Sales, Market.country.Pakistan.CHILDREN) >
110000000)
but is there any alternative way to do this, cuz here there are only 3
regions IF I got 20 or 25 (Regions) MEMBERS it will be a very long and
complex MDX.
I hope you ppl understand wot i m trying to say.
Help needed.
Thanks
Saulat

--
Posted via http://dbforums.com

Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: MDX Filter Help or atleast comment - 08-01-2003 , 11:48 AM






Ah, you need to use the quintessential CurrentMember function. Try this for
the filter:

Filter(
{Product.Team.MEMBERS},
(Time.Year.[2002], Measures.Sales, Market.CurrentMember)
Quote:
110000000)
Better yet, don't hardwire 2002, use Time.CurrentMember.

tom @ the domain below
www.tomchester.net


"saulat78" <saulat78 (AT) hotmail (DOT) com> wrote

Quote:
Hi guys,
I am new to MDX, well what I am trying to do is get those Product.Teams
whose Measure.Sales is greater then 110000000 in the Time.year.2002 in
every Market.country.Pakistan.MEMBERS, (i.e Regions) I hope u guyz
better understand by this way

SELECT { CrossJoin({Market.Country.[Pakistan].CHILDREN},
CrossJoin({Measures.[Sales]},{Time.Year.[2002]}))} ON COLUMNS,
{
Filter({Product.Team.MEMBERS}, (((Time.Year.[2002],Measures.Sales,
Market.country.Pakistan.Central) > 110000000) And
(Market.country.Pakistan.North,Time.Year.[2002],Measures.Sales)
110000000)
And ((Time.Year.[2002],Measures.Sales, Market.country.Pakistan.South)
110000000))
} ON ROWS FROM [Sales]

I wrote this MDX successfuly, the problem is the search condition where
I can't use the MEMBER keyword, and I have to write explicitly every
MEMBER of the region level of Market dimension with the whole condition
again and again with the AND operator; like I wrote
(((Time.Year.[2002],Measures.Sales, Market.country.Pakistan.Central)
110000000) And
(Market.country.Pakistan.North,Time.Year.[2002],Measures.Sales)
110000000)

I know I can't use
(((Time.Year.[2002],Measures.Sales, Market.country.Pakistan.CHILDREN)
110000000)
but is there any alternative way to do this, cuz here there are only 3
regions IF I got 20 or 25 (Regions) MEMBERS it will be a very long and
complex MDX.
I hope you ppl understand wot i m trying to say.
Help needed.
Thanks
Saulat

--
Posted via http://dbforums.com



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

Default Re: MDX Filter Help or atleast comment - 08-06-2003 , 08:30 AM




This is for tom chester.


if they use the Dimension.currentmember then it will compare to the
every member at every level of market dimension, and if it finds any
condision true it will return the result which will be wrong
according to
there requirement.


what he needs is to compare every member at the region level
of market dimension. AND the whole condition must be true if and only if
every member of market dimension at region level satisfy the condition.

Thats why he uses AND again and again.

Is there any way to do this without using AND again and again.


Thanks AND i hope you understand my question.

--
Posted via http://dbforums.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.