![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Given the following: Dimension Name: Issues Measure: Issue Count Dimension Attributes: Priority (Values 1,2,3,4) Severity (Values 1,2,3,4) How can I format an MDX statement to select Issues Where (Priority = 1 or Priority = 2) and (Severity = 1 or Severity = 2)? When I try the following: select [Measures].[Issue Count] on columns, ([Time].[Date].&[9/18/2005]:[Time].[Date].&[10/17/2005]) on rows From [Issues DB] where { ([Issues].[Priority].&[1]),([Issues].[Priority].&[2]), ([Issues].[Severity].&[1]), [Issues].[Severity].&[2] } I get the error referenced below: "Members belong to different hierarchies in the function." Any pointers would be greatly appreciated! ~Steven |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Correct me if I am wrong Mosha, but I would have thought that would only give you tuples where (priority = 1 and severity = 2) OR (priority = 2 and severity = 1). It will not give you everything where priority is 1 or 2 and severity is 1 or 2 I would have thought you would either have had to include all combinations like so: select [Measures].[Issue Count] on columns, ([Time].[Date].&[9/18/2005]:[Time].[Date].&[10/17/2005]) on rows From [Issues DB] where { ([Issues].[Priority].&[1],[Issues].[Severity].&[2]), ([Issues].[Priority].&[2],[Issues].[Severity].&[1]), ([Issues].[Priority].&[1],[Issues].[Severity].&[1]), ([Issues].[Priority].&[2],[Issues].[Severity].&[2]) } Or create them with a crossjoin select [Measures].[Issue Count] on columns, ([Time].[Date].&[9/18/2005]:[Time].[Date].&[10/17/2005]) on rows From [Issues DB] where { CROSSJOIN({[Issues].[Priority].&[1],[Issues].[Priority].&[2]},{[Issues]. [Severity].&[1]),[Issues].[Severity].&[2]}) } -- Regards Darren Gosbell [MCSD] dgosbell_at_yahoo_dot_com Blog: http://www.geekswithblogs.net/darrengosbell |
#5
| |||
| |||
|
|
Your answer is correct. However, it will not perform as efficient, as the query rewrite below. |
#6
| |||
| |||
|
|
I did offer 2 suggestions, one listing out the tuples and one using the CROSSJOIN() function. Are you saying that the * operator is faster than the CROSSJOIN() function or did you not notice my other alternative? I find CROSSJOIN() easier to read if I only have 2 sets to cross. |
|
I mainly listed out the first alternative to show all the different combinations. I did think not think that for this small example that there would be much difference in performance between the two approaches. |
|
Would I be right in saying that it is the auto exists feature that is boosting the performance in AS2k5 this case? |
#7
| |||
| |||
|
|
No - it just shows that I am not in good shape. Somehow I only saw first half of your replay. There is no difference in performance between CROSSJOIN and * operator. |
I can only imagine what it would be like at|
Could you clarify more on this point please.The autoexist operation would've produced same results for both sets (although it is still faster to do it when sets were crossjoin'ed for the similar reasons as I listed), but autoexist is really not playing any role here - sets in WHERE clause for that query are purely applying visual totals on the measure values. |

![]() |
| Thread Tools | |
| Display Modes | |
| |