dbTalk Databases Forums  

Slicer with more than one member of a dimension

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


Discuss Slicer with more than one member of a dimension in the microsoft.public.sqlserver.olap forum.



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

Default Slicer with more than one member of a dimension - 12-29-2004 , 10:11 AM






Hi,

I want to filter in the MDX select statement on more than one member of a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt



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

Default RE: Slicer with more than one member of a dimension - 12-29-2004 , 12:31 PM






If you mean you want to see the aggregated complaints for both years, you
can create a calc member, as in:

with member time.[MyPeriods] as 'sum({ [Time].[Year].[2000] ,
[Time].[Year].[2001]})'

and then use it a slicer :

where (Time.MyPeriods)

Take into account that the where clause in MDX specifies a tuple, and a
tuple can
contain only one member from each dimension.

If you want to see the complaints for each year then you can change your
query to:

SELECT
{[Time].[Year].[2000].Members, [Time].[Year].[2001]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Measures].[ComplaintCount])

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

"Thorsten Blawatt" wrote:

Quote:
Hi,

I want to filter in the MDX select statement on more than one member of a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt




Reply With Quote
  #3  
Old   
Thorsten Blawatt
 
Posts: n/a

Default Re: Slicer with more than one member of a dimension - 12-30-2004 , 02:37 AM



Hi Brian,

thanks for response. I want to implementing a filter control. It shows for
each dimension all members in a checkbox tree. The user will be able to
disable members by checking a tree entry.
For example I have a dimension time with a level year. In the filtercontrol
the members 2000, 2001, 2002, 2003 and 2004 will shown. When the user only
want to view the data for the last 2 years, he must disable 2000, 2001 and
2003. The MDX WHERE statement must looks like:
WHERE ([Time].[Year].[2003].Members, [Time].[Year].[2004])

But as you say, the WHERE statement can contain only one member for each
dimension.

Is there another way to solve my problem?

Best regards,
Thorsten Blawatt


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:FC4DA046-F955-4266-A3E8-875B3E9A21FD (AT) microsoft (DOT) com...
Quote:
If you mean you want to see the aggregated complaints for both years, you
can create a calc member, as in:

with member time.[MyPeriods] as 'sum({ [Time].[Year].[2000] ,
[Time].[Year].[2001]})'

and then use it a slicer :

where (Time.MyPeriods)

Take into account that the where clause in MDX specifies a tuple, and a
tuple can
contain only one member from each dimension.

If you want to see the complaints for each year then you can change your
query to:

SELECT
{[Time].[Year].[2000].Members, [Time].[Year].[2001]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Measures].[ComplaintCount])

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

"Thorsten Blawatt" wrote:

Hi,

I want to filter in the MDX select statement on more than one member of
a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt






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

Default Re: Slicer with more than one member of a dimension - 12-30-2004 , 07:03 AM



What's wrong with the "With member Time.[MyPeriods]..." approach I outlined in
my first reply?
From what you say that should work. In fact , OWC a more sophisticated
version of the same principle.
Regards,
Brian

"Thorsten Blawatt" wrote:

Quote:
Hi Brian,

thanks for response. I want to implementing a filter control. It shows for
each dimension all members in a checkbox tree. The user will be able to
disable members by checking a tree entry.
For example I have a dimension time with a level year. In the filtercontrol
the members 2000, 2001, 2002, 2003 and 2004 will shown. When the user only
want to view the data for the last 2 years, he must disable 2000, 2001 and
2003. The MDX WHERE statement must looks like:
WHERE ([Time].[Year].[2003].Members, [Time].[Year].[2004])

But as you say, the WHERE statement can contain only one member for each
dimension.

Is there another way to solve my problem?

Best regards,
Thorsten Blawatt


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:FC4DA046-F955-4266-A3E8-875B3E9A21FD (AT) microsoft (DOT) com...
If you mean you want to see the aggregated complaints for both years, you
can create a calc member, as in:

with member time.[MyPeriods] as 'sum({ [Time].[Year].[2000] ,
[Time].[Year].[2001]})'

and then use it a slicer :

where (Time.MyPeriods)

Take into account that the where clause in MDX specifies a tuple, and a
tuple can
contain only one member from each dimension.

If you want to see the complaints for each year then you can change your
query to:

SELECT
{[Time].[Year].[2000].Members, [Time].[Year].[2001]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Measures].[ComplaintCount])

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

"Thorsten Blawatt" wrote:

Hi,

I want to filter in the MDX select statement on more than one member of
a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt







Reply With Quote
  #5  
Old   
Thorsten Blawatt
 
Posts: n/a

Default Re: Slicer with more than one member of a dimension - 12-30-2004 , 09:14 AM



Sorry Brian,

now I've tried the sample and it works fine. I have misunderstood the first
mail from you.
Thank you.

Best regards,
Thorsten


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:F7CD6793-935F-4D20-B2F7-689335A6190F (AT) microsoft (DOT) com...
Quote:
What's wrong with the "With member Time.[MyPeriods]..." approach I
outlined in
my first reply?
From what you say that should work. In fact , OWC a more sophisticated
version of the same principle.
Regards,
Brian

"Thorsten Blawatt" wrote:

Hi Brian,

thanks for response. I want to implementing a filter control. It shows
for
each dimension all members in a checkbox tree. The user will be able to
disable members by checking a tree entry.
For example I have a dimension time with a level year. In the
filtercontrol
the members 2000, 2001, 2002, 2003 and 2004 will shown. When the user
only
want to view the data for the last 2 years, he must disable 2000, 2001
and
2003. The MDX WHERE statement must looks like:
WHERE ([Time].[Year].[2003].Members, [Time].[Year].[2004])

But as you say, the WHERE statement can contain only one member for each
dimension.

Is there another way to solve my problem?

Best regards,
Thorsten Blawatt


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:FC4DA046-F955-4266-A3E8-875B3E9A21FD (AT) microsoft (DOT) com...
If you mean you want to see the aggregated complaints for both years,
you
can create a calc member, as in:

with member time.[MyPeriods] as 'sum({ [Time].[Year].[2000] ,
[Time].[Year].[2001]})'

and then use it a slicer :

where (Time.MyPeriods)

Take into account that the where clause in MDX specifies a tuple, and
a
tuple can
contain only one member from each dimension.

If you want to see the complaints for each year then you can change
your
query to:

SELECT
{[Time].[Year].[2000].Members, [Time].[Year].[2001]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Measures].[ComplaintCount])

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

"Thorsten Blawatt" wrote:

Hi,

I want to filter in the MDX select statement on more than one member
of
a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for
the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt









Reply With Quote
  #6  
Old   
Thorsten Blawatt
 
Posts: n/a

Default Re: Slicer with more than one member of a dimension - 12-30-2004 , 09:37 AM



Sorry Brian,

I still have a short question: Is it possible to set a filter for more than
one dimension?
Example:

WITH MEMBER [OpenedOn].[MyPeriods] AS 'sum({ [OpenedOn].[OpenedOnY].[2000],
[OpenedOn].[OpenedOnY].[2001], [OpenedOn].[OpenedOnY].[2002]})'
WITH MEMBER [ClosedOn].[MyNewPeriods] AS 'sum({ [ClosedOn].[ClosedOnQ].[1],
[ClosedOn].[ClosedOnQ].[2]})'
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([OpenedOn].[MyPeriods], [ClosedOn].[MyNewPeriods])

Here I want to see all complains created in the years 2000, 2001 and 2002
and which are closed on quarter 1 and 2.
When I have 2 "WITH MEMBER" blocks I cannot execute the query.
Is it possible to do some thing like this?


Best regards,
Thorsten


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:F7CD6793-935F-4D20-B2F7-689335A6190F (AT) microsoft (DOT) com...
Quote:
What's wrong with the "With member Time.[MyPeriods]..." approach I
outlined in
my first reply?
From what you say that should work. In fact , OWC a more sophisticated
version of the same principle.
Regards,
Brian

"Thorsten Blawatt" wrote:

Hi Brian,

thanks for response. I want to implementing a filter control. It shows
for
each dimension all members in a checkbox tree. The user will be able to
disable members by checking a tree entry.
For example I have a dimension time with a level year. In the
filtercontrol
the members 2000, 2001, 2002, 2003 and 2004 will shown. When the user
only
want to view the data for the last 2 years, he must disable 2000, 2001
and
2003. The MDX WHERE statement must looks like:
WHERE ([Time].[Year].[2003].Members, [Time].[Year].[2004])

But as you say, the WHERE statement can contain only one member for each
dimension.

Is there another way to solve my problem?

Best regards,
Thorsten Blawatt


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:FC4DA046-F955-4266-A3E8-875B3E9A21FD (AT) microsoft (DOT) com...
If you mean you want to see the aggregated complaints for both years,
you
can create a calc member, as in:

with member time.[MyPeriods] as 'sum({ [Time].[Year].[2000] ,
[Time].[Year].[2001]})'

and then use it a slicer :

where (Time.MyPeriods)

Take into account that the where clause in MDX specifies a tuple, and
a
tuple can
contain only one member from each dimension.

If you want to see the complaints for each year then you can change
your
query to:

SELECT
{[Time].[Year].[2000].Members, [Time].[Year].[2001]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Measures].[ComplaintCount])

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

"Thorsten Blawatt" wrote:

Hi,

I want to filter in the MDX select statement on more than one member
of
a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for
the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt









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

Default Re: Slicer with more than one member of a dimension - 12-30-2004 , 11:25 AM



You shoud use only one With per query, as in:

With Member <def1>
Member <def2>
Select

Note that there is no comma between member defs.
See "Using WITH to Create Calculated Members" in BOL for an example.
Regards,
Brian

"Thorsten Blawatt" wrote:

Quote:
Sorry Brian,

I still have a short question: Is it possible to set a filter for more than
one dimension?
Example:

WITH MEMBER [OpenedOn].[MyPeriods] AS 'sum({ [OpenedOn].[OpenedOnY].[2000],
[OpenedOn].[OpenedOnY].[2001], [OpenedOn].[OpenedOnY].[2002]})'
WITH MEMBER [ClosedOn].[MyNewPeriods] AS 'sum({ [ClosedOn].[ClosedOnQ].[1],
[ClosedOn].[ClosedOnQ].[2]})'
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([OpenedOn].[MyPeriods], [ClosedOn].[MyNewPeriods])

Here I want to see all complains created in the years 2000, 2001 and 2002
and which are closed on quarter 1 and 2.
When I have 2 "WITH MEMBER" blocks I cannot execute the query.
Is it possible to do some thing like this?


Best regards,
Thorsten


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:F7CD6793-935F-4D20-B2F7-689335A6190F (AT) microsoft (DOT) com...
What's wrong with the "With member Time.[MyPeriods]..." approach I
outlined in
my first reply?
From what you say that should work. In fact , OWC a more sophisticated
version of the same principle.
Regards,
Brian

"Thorsten Blawatt" wrote:

Hi Brian,

thanks for response. I want to implementing a filter control. It shows
for
each dimension all members in a checkbox tree. The user will be able to
disable members by checking a tree entry.
For example I have a dimension time with a level year. In the
filtercontrol
the members 2000, 2001, 2002, 2003 and 2004 will shown. When the user
only
want to view the data for the last 2 years, he must disable 2000, 2001
and
2003. The MDX WHERE statement must looks like:
WHERE ([Time].[Year].[2003].Members, [Time].[Year].[2004])

But as you say, the WHERE statement can contain only one member for each
dimension.

Is there another way to solve my problem?

Best regards,
Thorsten Blawatt


"Brian Altmann" <findme@thesignaturewebsite> schrieb im Newsbeitrag
news:FC4DA046-F955-4266-A3E8-875B3E9A21FD (AT) microsoft (DOT) com...
If you mean you want to see the aggregated complaints for both years,
you
can create a calc member, as in:

with member time.[MyPeriods] as 'sum({ [Time].[Year].[2000] ,
[Time].[Year].[2001]})'

and then use it a slicer :

where (Time.MyPeriods)

Take into account that the where clause in MDX specifies a tuple, and
a
tuple can
contain only one member from each dimension.

If you want to see the complaints for each year then you can change
your
query to:

SELECT
{[Time].[Year].[2000].Members, [Time].[Year].[2001]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Measures].[ComplaintCount])

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

"Thorsten Blawatt" wrote:

Hi,

I want to filter in the MDX select statement on more than one member
of
a
dimension.
I want to do some thing like this:
SELECT
{[Measures].[ComplaintCount]} ON COLUMNS,
[ComplaintCause].[ComplaintCause].MEMBERS ON ROWS
FROM [myCube]
WHERE ([Time].[Year].[2000].Members, [Time].[Year].[2001])

I want to see all complaints distributed on the complaint causes for
the
years 2000 and 2001.

Is there a way to do?

Best regards,
Thorsten Blawatt










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.