![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a few questions about the evaluation of a named set which is saved on a MSAS server (MSAS 2000 SP-3). Let's say that I have a simple cube with a single dimension and two measures. No calculated cells, no calculated members or custom rollup formulas or custom members - just raw data. Then, let's say that I create a named set on the server using the following MDX expression: Order([Dimension1].Members, [Measures].[M1], DESC) When I run an MDX query from a client and position the named set on one of the axes, I see that the set is ordered by the value of M1 in descending order. This tells me that the named set is evaluated against the raw data, which is calculated (obtained) at calculation pass 0. Then, let's say that I create a calculated cell. The calculated cell parameters are: Sub-cube: [Measures].[M1] MDX Expression: ([Measures].[M2]) Calculation Pass: 1 Calculation Depth: 1 Solve Order: 0 This calculated cell basically masks measure M1 and replaces its values with the values of M2. Now, when I run the same MDX query in the client application, I see that the named set is still ordered by the values of M1, not M2. On the other hand, if I define a named set in the client MDX query using the "WITH SET" construct, the set is evaluated against the values populated by the calculated cell. I did all this and my logical conclusion was that the server-defined named set is evaluated only against data calculated in calculation pass 0 and since the calculated cell reports data in calculation pass 1, the calculation cell has no impact on the named set evaluation. Then I used CalculationCurrentPass() in the MDX expression of the named set just to prove that my theory is correct. However, to make things more confusing, CalculationCurrentPass() returned 1 when it was calculated during the evaluation of the named set's expression. My questions are: When exactly is a server-defined named set evaluated? Against the data of which calculation pass? Is there a way to make a server-defined named set use the data returned by a calculated cell (which calculates at calculation pass 1 or higher)? Thanks in advance! Vassil |
#3
| |||
| |||
|
|
I have a few questions about the evaluation of a named set which is saved on a MSAS server (MSAS 2000 SP-3). Let's say that I have a simple cube with a single dimension and two measures. No calculated cells, no calculated members or custom rollup formulas or custom members - just raw data. Then, let's say that I create a named set on the server using the following MDX expression: Order([Dimension1].Members, [Measures].[M1], DESC) When I run an MDX query from a client and position the named set on one of the axes, I see that the set is ordered by the value of M1 in descending order. This tells me that the named set is evaluated against the raw data, which is calculated (obtained) at calculation pass 0. Then, let's say that I create a calculated cell. The calculated cell parameters are: Sub-cube: [Measures].[M1] MDX Expression: ([Measures].[M2]) Calculation Pass: 1 Calculation Depth: 1 Solve Order: 0 This calculated cell basically masks measure M1 and replaces its values with the values of M2. Now, when I run the same MDX query in the client application, I see that the named set is still ordered by the values of M1, not M2. On the other hand, if I define a named set in the client MDX query using the "WITH SET" construct, the set is evaluated against the values populated by the calculated cell. I did all this and my logical conclusion was that the server-defined named set is evaluated only against data calculated in calculation pass 0 and since the calculated cell reports data in calculation pass 1, the calculation cell has no impact on the named set evaluation. Then I used CalculationCurrentPass() in the MDX expression of the named set just to prove that my theory is correct. However, to make things more confusing, CalculationCurrentPass() returned 1 when it was calculated during the evaluation of the named set's expression. My questions are: When exactly is a server-defined named set evaluated? Against the data of which calculation pass? Is there a way to make a server-defined named set use the data returned by a calculated cell (which calculates at calculation pass 1 or higher)? Thanks in advance! Vassil |
#4
| |||
| |||
|
|
The answer to your question is simple. The only thing which controls what is evaluated when is controlled by the order of Command objects in DSO. Therefore if CREATE SET statement is before CREATE CELL CALCULATION statement, then CREATE SET is evaluated using pass 0. However, if CREATE SET is after CREATE CELL CALCULATION, then it uses the higher pass. Now, Analysis Manager UI does some reordering of commands, such that all calculated members come together, all named sets come together, all actions come together etc - I don't remember the exact sequence. If for your needs this isn't satisfactory - you will have to write custom DSO code. In AS2005 you can put statements inside MDX Script in any order you want, and UI will never mess with it. -- ================================================== Mosha Pasumansky - http://www.mosha.com/msolap Analysis Services blog at http://www.sqljunkies.com/WebLog/mosha Development Lead in the Analysis Server team All you need is love (John Lennon) Disclaimer : This posting is provided "AS IS" with no warranties, and confers no rights. ================================================== "Vassil Kovatchev" <vassil.kovatchev (AT) gmail (DOT) com> wrote in message news:1105487505.463286.104150 (AT) f14g2000cwb (DOT) googlegroups.com... I have a few questions about the evaluation of a named set which is saved on a MSAS server (MSAS 2000 SP-3). Let's say that I have a simple cube with a single dimension and two measures. No calculated cells, no calculated members or custom rollup formulas or custom members - just raw data. Then, let's say that I create a named set on the server using the following MDX expression: Order([Dimension1].Members, [Measures].[M1], DESC) When I run an MDX query from a client and position the named set on one of the axes, I see that the set is ordered by the value of M1 in descending order. This tells me that the named set is evaluated against the raw data, which is calculated (obtained) at calculation pass 0. Then, let's say that I create a calculated cell. The calculated cell parameters are: Sub-cube: [Measures].[M1] MDX Expression: ([Measures].[M2]) Calculation Pass: 1 Calculation Depth: 1 Solve Order: 0 This calculated cell basically masks measure M1 and replaces its values with the values of M2. Now, when I run the same MDX query in the client application, I see that the named set is still ordered by the values of M1, not M2. On the other hand, if I define a named set in the client MDX query using the "WITH SET" construct, the set is evaluated against the values populated by the calculated cell. I did all this and my logical conclusion was that the server-defined named set is evaluated only against data calculated in calculation pass 0 and since the calculated cell reports data in calculation pass 1, the calculation cell has no impact on the named set evaluation. Then I used CalculationCurrentPass() in the MDX expression of the named set just to prove that my theory is correct. However, to make things more confusing, CalculationCurrentPass() returned 1 when it was calculated during the evaluation of the named set's expression. My questions are: When exactly is a server-defined named set evaluated? Against the data of which calculation pass? Is there a way to make a server-defined named set use the data returned by a calculated cell (which calculates at calculation pass 1 or higher)? Thanks in advance! Vassil |
#5
| |||
| |||
|
|
Mosha, thanks for the quick response. This is exactly what I was hoping for - answer from an insider. I will try to reorder the command statements with DSO. Thanks again! Vassil Mosha Pasumansky [MS] wrote: The answer to your question is simple. The only thing which controls what is evaluated when is controlled by the order of Command objects in DSO. Therefore if CREATE SET statement is before CREATE CELL CALCULATION statement, then CREATE SET is evaluated using pass 0. However, if CREATE SET is after CREATE CELL CALCULATION, then it uses the higher pass. Now, Analysis Manager UI does some reordering of commands, such that all calculated members come together, all named sets come together, all actions come together etc - I don't remember the exact sequence. If for your needs this isn't satisfactory - you will have to write custom DSO code. In AS2005 you can put statements inside MDX Script in any order you want, and UI will never mess with it. -- ================================================== Mosha Pasumansky - http://www.mosha.com/msolap Analysis Services blog at http://www.sqljunkies.com/WebLog/mosha Development Lead in the Analysis Server team All you need is love (John Lennon) Disclaimer : This posting is provided "AS IS" with no warranties, and confers no rights. ================================================== "Vassil Kovatchev" <vassil.kovatchev (AT) gmail (DOT) com> wrote in message news:1105487505.463286.104150 (AT) f14g2000cwb (DOT) googlegroups.com... I have a few questions about the evaluation of a named set which is saved on a MSAS server (MSAS 2000 SP-3). Let's say that I have a simple cube with a single dimension and two measures. No calculated cells, no calculated members or custom rollup formulas or custom members - just raw data. Then, let's say that I create a named set on the server using the following MDX expression: Order([Dimension1].Members, [Measures].[M1], DESC) When I run an MDX query from a client and position the named set on one of the axes, I see that the set is ordered by the value of M1 in descending order. This tells me that the named set is evaluated against the raw data, which is calculated (obtained) at calculation pass 0. Then, let's say that I create a calculated cell. The calculated cell parameters are: Sub-cube: [Measures].[M1] MDX Expression: ([Measures].[M2]) Calculation Pass: 1 Calculation Depth: 1 Solve Order: 0 This calculated cell basically masks measure M1 and replaces its values with the values of M2. Now, when I run the same MDX query in the client application, I see that the named set is still ordered by the values of M1, not M2. On the other hand, if I define a named set in the client MDX query using the "WITH SET" construct, the set is evaluated against the values populated by the calculated cell. I did all this and my logical conclusion was that the server-defined named set is evaluated only against data calculated in calculation pass 0 and since the calculated cell reports data in calculation pass 1, the calculation cell has no impact on the named set evaluation. Then I used CalculationCurrentPass() in the MDX expression of the named set just to prove that my theory is correct. However, to make things more confusing, CalculationCurrentPass() returned 1 when it was calculated during the evaluation of the named set's expression. My questions are: When exactly is a server-defined named set evaluated? Against the data of which calculation pass? Is there a way to make a server-defined named set use the data returned by a calculated cell (which calculates at calculation pass 1 or higher)? Thanks in advance! Vassil |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |