![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |