dbTalk Databases Forums  

Filter a member in a dimension

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


Discuss Filter a member in a dimension in the microsoft.public.sqlserver.olap forum.



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

Default Filter a member in a dimension - 04-11-2005 , 04:50 AM






Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level (APAC, EMEA,
OTHER), the measure should show NULL. But i want to exclude 'OTHER', so the
NULL only needs to be shown for APAC and EMEA. I have tried the filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to an
expression. In examples i see that in place of the conditional expression
there should be a measure instead of a dimension. So i guess i cannot use the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley




Reply With Quote
  #2  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: Filter a member in a dimension - 04-11-2005 , 12:03 PM






First of all, {[Location]} means {[Location].CurrentMember}. I guess it is
not what you wanted.

If you want to select only OTHER, just {[OTHER]} is enough. If you want to
exclude OTHER, Except(SecondLevel.Members, {[OTHER]}) will be useful.

Ohjoo Kwon


"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level (APAC, EMEA,
OTHER), the measure should show NULL. But i want to exclude 'OTHER', so
the
NULL only needs to be shown for APAC and EMEA. I have tried the filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to an
expression. In examples i see that in place of the conditional expression
there should be a measure instead of a dimension. So i guess i cannot use
the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley






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

Default Re: Filter a member in a dimension - 04-12-2005 , 03:25 AM



Hi Ohjoo,

thnx for the response, but this one gives me the same error also. And
according to the help the except finds differences between 2 sets, it does
not exclude a member.

Thnx,

Stanley

"Ohjoo Kwon" wrote:

Quote:
First of all, {[Location]} means {[Location].CurrentMember}. I guess it is
not what you wanted.

If you want to select only OTHER, just {[OTHER]} is enough. If you want to
exclude OTHER, Except(SecondLevel.Members, {[OTHER]}) will be useful.

Ohjoo Kwon


"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:CC0D02D1-2783-4043-B9BE-90AEE0E335EA (AT) microsoft (DOT) com...
Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level (APAC, EMEA,
OTHER), the measure should show NULL. But i want to exclude 'OTHER', so
the
NULL only needs to be shown for APAC and EMEA. I have tried the filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to an
expression. In examples i see that in place of the conditional expression
there should be a measure instead of a dimension. So i guess i cannot use
the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley







Reply With Quote
  #4  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: Filter a member in a dimension - 04-12-2005 , 04:48 AM



Here difference means difference set.

In my sample, SecondLevel.Members returns all members, {APAC, EMEA, OTHER},
at second level. [Other] is a member at second level too, so it is included
in the result set.

Finally, Except(SecondLevel.Members, {[OTHER]}) should returns all members
at second level without [Other] member. In other words, {APAC, EMEA}

Ohjoo



"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi Ohjoo,

thnx for the response, but this one gives me the same error also. And
according to the help the except finds differences between 2 sets, it does
not exclude a member.

Thnx,

Stanley

"Ohjoo Kwon" wrote:

First of all, {[Location]} means {[Location].CurrentMember}. I guess it
is
not what you wanted.

If you want to select only OTHER, just {[OTHER]} is enough. If you want
to
exclude OTHER, Except(SecondLevel.Members, {[OTHER]}) will be useful.

Ohjoo Kwon


"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:CC0D02D1-2783-4043-B9BE-90AEE0E335EA (AT) microsoft (DOT) com...
Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level (APAC,
EMEA,
OTHER), the measure should show NULL. But i want to exclude 'OTHER',
so
the
NULL only needs to be shown for APAC and EMEA. I have tried the
filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to an
expression. In examples i see that in place of the conditional
expression
there should be a measure instead of a dimension. So i guess i cannot
use
the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley









Reply With Quote
  #5  
Old   
Stanley
 
Posts: n/a

Default Re: Filter a member in a dimension - 04-12-2005 , 05:42 AM



In the MDX sample application it works:

select {[Measures].[Sales]} on columns,
{Except([Location].[Level 02].members,{[OTHER]})} on rows
from Sales

I don't see 'OTHER'

But when i use only this part:

Except([Location].[Level 02].members,{[OTH]})

as a condition for the calculated cell, it doesn't work. That's my obstacle
actually.

thnx,

Stanley

"Ohjoo Kwon" wrote:

Quote:
Here difference means difference set.

In my sample, SecondLevel.Members returns all members, {APAC, EMEA, OTHER},
at second level. [Other] is a member at second level too, so it is included
in the result set.

Finally, Except(SecondLevel.Members, {[OTHER]}) should returns all members
at second level without [Other] member. In other words, {APAC, EMEA}

Ohjoo



"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:A93B9175-556A-4816-965C-2A9DB37904D7 (AT) microsoft (DOT) com...
Hi Ohjoo,

thnx for the response, but this one gives me the same error also. And
according to the help the except finds differences between 2 sets, it does
not exclude a member.

Thnx,

Stanley

"Ohjoo Kwon" wrote:

First of all, {[Location]} means {[Location].CurrentMember}. I guess it
is
not what you wanted.

If you want to select only OTHER, just {[OTHER]} is enough. If you want
to
exclude OTHER, Except(SecondLevel.Members, {[OTHER]}) will be useful.

Ohjoo Kwon


"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:CC0D02D1-2783-4043-B9BE-90AEE0E335EA (AT) microsoft (DOT) com...
Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level (APAC,
EMEA,
OTHER), the measure should show NULL. But i want to exclude 'OTHER',
so
the
NULL only needs to be shown for APAC and EMEA. I have tried the
filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to an
expression. In examples i see that in place of the conditional
expression
there should be a measure instead of a dimension. So i guess i cannot
use
the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley










Reply With Quote
  #6  
Old   
Ohjoo Kwon
 
Posts: n/a

Default Re: Filter a member in a dimension - 04-12-2005 , 07:15 AM



Except() returns Set not Boolean.

What is your exact condition? Not {OTHER}? If then,

NOT Location.CurrentMember IS [OTHER]

Ohjoo

"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote

Quote:
In the MDX sample application it works:

select {[Measures].[Sales]} on columns,
{Except([Location].[Level 02].members,{[OTHER]})} on rows
from Sales

I don't see 'OTHER'

But when i use only this part:

Except([Location].[Level 02].members,{[OTH]})

as a condition for the calculated cell, it doesn't work. That's my
obstacle
actually.

thnx,

Stanley

"Ohjoo Kwon" wrote:

Here difference means difference set.

In my sample, SecondLevel.Members returns all members, {APAC, EMEA,
OTHER},
at second level. [Other] is a member at second level too, so it is
included
in the result set.

Finally, Except(SecondLevel.Members, {[OTHER]}) should returns all
members
at second level without [Other] member. In other words, {APAC, EMEA}

Ohjoo



"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:A93B9175-556A-4816-965C-2A9DB37904D7 (AT) microsoft (DOT) com...
Hi Ohjoo,

thnx for the response, but this one gives me the same error also. And
according to the help the except finds differences between 2 sets, it
does
not exclude a member.

Thnx,

Stanley

"Ohjoo Kwon" wrote:

First of all, {[Location]} means {[Location].CurrentMember}. I guess
it
is
not what you wanted.

If you want to select only OTHER, just {[OTHER]} is enough. If you
want
to
exclude OTHER, Except(SecondLevel.Members, {[OTHER]}) will be
useful.

Ohjoo Kwon


"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:CC0D02D1-2783-4043-B9BE-90AEE0E335EA (AT) microsoft (DOT) com...
Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level
(APAC,
EMEA,
OTHER), the measure should show NULL. But i want to exclude
'OTHER',
so
the
NULL only needs to be shown for APAC and EMEA. I have tried the
filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to
an
expression. In examples i see that in place of the conditional
expression
there should be a measure instead of a dimension. So i guess i
cannot
use
the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley












Reply With Quote
  #7  
Old   
Stanley
 
Posts: n/a

Default Re: Filter a member in a dimension - 04-12-2005 , 07:54 AM



Ok Ohjoo, this works. I had tried something like this before:

NOT(Location.CurrentMember.name IS "OTHER")

But i didn't know that OTHER had to be between brackets instead of quotes.

Thank you very much.

regards,

Stanley


"Ohjoo Kwon" wrote:

Quote:
Except() returns Set not Boolean.

What is your exact condition? Not {OTHER}? If then,

NOT Location.CurrentMember IS [OTHER]

Ohjoo

"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:63064659-8464-4565-A22C-6D8CC1EFCA2C (AT) microsoft (DOT) com...
In the MDX sample application it works:

select {[Measures].[Sales]} on columns,
{Except([Location].[Level 02].members,{[OTHER]})} on rows
from Sales

I don't see 'OTHER'

But when i use only this part:

Except([Location].[Level 02].members,{[OTH]})

as a condition for the calculated cell, it doesn't work. That's my
obstacle
actually.

thnx,

Stanley

"Ohjoo Kwon" wrote:

Here difference means difference set.

In my sample, SecondLevel.Members returns all members, {APAC, EMEA,
OTHER},
at second level. [Other] is a member at second level too, so it is
included
in the result set.

Finally, Except(SecondLevel.Members, {[OTHER]}) should returns all
members
at second level without [Other] member. In other words, {APAC, EMEA}

Ohjoo



"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:A93B9175-556A-4816-965C-2A9DB37904D7 (AT) microsoft (DOT) com...
Hi Ohjoo,

thnx for the response, but this one gives me the same error also. And
according to the help the except finds differences between 2 sets, it
does
not exclude a member.

Thnx,

Stanley

"Ohjoo Kwon" wrote:

First of all, {[Location]} means {[Location].CurrentMember}. I guess
it
is
not what you wanted.

If you want to select only OTHER, just {[OTHER]} is enough. If you
want
to
exclude OTHER, Except(SecondLevel.Members, {[OTHER]}) will be
useful.

Ohjoo Kwon


"Stanley" <Stanley (AT) discussions (DOT) microsoft.com> wrote in message
news:CC0D02D1-2783-4043-B9BE-90AEE0E335EA (AT) microsoft (DOT) com...
Hi,

I have this cube:
a measure 'Test'
a dimension 'Location'

the location dimension looks like this:
Global
APAC
China
Singapore
EMEA
Belgium
Spain
OTHER

I made a calculated Cell, that when i roll up on second level
(APAC,
EMEA,
OTHER), the measure should show NULL. But i want to exclude
'OTHER',
so
the
NULL only needs to be shown for APAC and EMEA. I have tried the
filter:

Filter({[Location]},[Location].Currentmember.Name="OTHER")

But this gives an error. It says that it cannot convert the set to
an
expression. In examples i see that in place of the conditional
expression
there should be a measure instead of a dimension. So i guess i
cannot
use
the
filter???

How can i achieve to filter 'OTHER'?

Thnx in advance

Stanley













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.