![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I thought it is possible use the Exixting Statement in AS 2005 to calculate a set in an othe context then te cube context. So for exampel: [Dim Product].[Color].members=1; scope([Dim Product].[Color].[Black]); [Dim Product].[Color].[All]=sum(existing([Dim Product].[Color].members)); end scope; But after this skript the value of [Dim Product].[Color].[All] is eleven and not as I expectet one. Do I misunderstand the existing-statement or is a mistake in my skript? thanks stefan |
#3
| |||
| |||
|
|
I think you've misunderstood what the EXISTING and SCOPE statements are meant to do. Can you give me some idea of what you'd like to achieve? Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "sd@dbconn" wrote: Hello, I thought it is possible use the Exixting Statement in AS 2005 to calculate a set in an othe context then te cube context. So for exampel: [Dim Product].[Color].members=1; scope([Dim Product].[Color].[Black]); [Dim Product].[Color].[All]=sum(existing([Dim Product].[Color].members)); end scope; But after this skript the value of [Dim Product].[Color].[All] is eleven and not as I expectet one. Do I misunderstand the existing-statement or is a mistake in my skript? thanks stefan |
#4
| |||
| |||
|
|
Hi Chris, At the moment my main focus is to understand the EXISTING statement. In BOL I found this: By default, sets are evaluated within the context of the cube that contains the members of the set. The Existing statement forces a set specified in Set_Expression to be evaluated within the current context instead. I thought the SCOPE statement produces a new context, in this Case ([Dim Product].[Color].[Black]. Then the my hope was that the EXISTING forces the SET [Dim Product].[Color].members to be evaluated in the subcube context. But it fails. So what is the use of the EXISTING statement, do you have an example? stefan "Chris Webb" wrote: I think you've misunderstood what the EXISTING and SCOPE statements are meant to do. Can you give me some idea of what you'd like to achieve? Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "sd@dbconn" wrote: Hello, I thought it is possible use the Exixting Statement in AS 2005 to calculate a set in an othe context then te cube context. So for exampel: [Dim Product].[Color].members=1; scope([Dim Product].[Color].[Black]); [Dim Product].[Color].[All]=sum(existing([Dim Product].[Color].members)); end scope; But after this skript the value of [Dim Product].[Color].[All] is eleven and not as I expectet one. Do I misunderstand the existing-statement or is a mistake in my skript? thanks stefan |
#5
| |||
| |||
|
|
Hi Stefan, The context being referred to here is the query context, I think. Here's an example query with Adventure Works: WITH MEMBER MEASURES.OCC AS GENERATE(EXISTING [Customer].[Occupation].[Occupation].MEMBERS, [Customer].[Occupation].CURRENTMEMBER.NAME, ",") SELECT MEASURES.OCC ON 0, [Customer].[Yearly Income].[Yearly Income].MEMBERS ON 1 FROM [ADVENTURE WORKS] In this case you can see which occupations 'exist' with each member on the yearly income hierarchy. HTH, Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "sd@dbconn" wrote: Hi Chris, At the moment my main focus is to understand the EXISTING statement. In BOL I found this: By default, sets are evaluated within the context of the cube that contains the members of the set. The Existing statement forces a set specified in Set_Expression to be evaluated within the current context instead. I thought the SCOPE statement produces a new context, in this Case ([Dim Product].[Color].[Black]. Then the my hope was that the EXISTING forces the SET [Dim Product].[Color].members to be evaluated in the subcube context. But it fails. So what is the use of the EXISTING statement, do you have an example? stefan "Chris Webb" wrote: I think you've misunderstood what the EXISTING and SCOPE statements are meant to do. Can you give me some idea of what you'd like to achieve? Chris -- Blog at: http://spaces.msn.com/members/cwebbbi/ "sd@dbconn" wrote: Hello, I thought it is possible use the Exixting Statement in AS 2005 to calculate a set in an othe context then te cube context. So for exampel: [Dim Product].[Color].members=1; scope([Dim Product].[Color].[Black]); [Dim Product].[Color].[All]=sum(existing([Dim Product].[Color].members)); end scope; But after this skript the value of [Dim Product].[Color].[All] is eleven and not as I expectet one. Do I misunderstand the existing-statement or is a mistake in my skript? thanks stefan |
![]() |
| Thread Tools | |
| Display Modes | |
| |