![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've picked this syntax up from various sources on the web to generate an MDX query. Assuming I'm using SQL 2000 and have calculated members/measures in the cube, is there a more efficient method or less verbose syntax?. It works fine. I'm just curious if any of the MDX guru's out there have a better solution. SELECT Non Empty Head({[Gender].Members*{[Measures].[Employee Count]}},250) ON COLUMNS, HEAD(Filter([Employees].Children, Count( Filter({Axis(0)* {[Ethnicity].[Hispanic]}}, NOT IsEmpty(Measures.CurrentMember)))>0 ),500) ON ROWS FROM [CubeName] WHERE [Ethnicity].[Hispanic] |
#3
| |||
| |||
|
|
In your row axis it is redundant to filter by axis(0) and [Ethnicity]. [Hispanic]. The context of the values in the cells that are returned from an MDX query are the intersection of all the axis (including the where clause) so the following query should be equivalent SELECT Non Empty Head({[Gender].Members},250) ON COLUMNS, HEAD(Filter([Employees].Children, NOT IsEmpty (Measures.CurrentMember)),500) ON ROWS FROM [CubeName] WHERE ([Ethnicity].[Hispanic],[Measures].[Employee Count]) -- Regards Darren Gosbell - SQL Server MVP Blog: http://www.geekswithblogs.net/darrengosbell In article <1158174865.295655.100670 (AT) p79g2000cwp (DOT) googlegroups.com>, shovde (AT) gmail (DOT) com says... I've picked this syntax up from various sources on the web to generate an MDX query. Assuming I'm using SQL 2000 and have calculated members/measures in the cube, is there a more efficient method or less verbose syntax?. It works fine. I'm just curious if any of the MDX guru's out there have a better solution. SELECT Non Empty Head({[Gender].Members*{[Measures].[Employee Count]}},250) ON COLUMNS, HEAD(Filter([Employees].Children, Count( Filter({Axis(0)* {[Ethnicity].[Hispanic]}}, NOT IsEmpty(Measures.CurrentMember)))>0 ),500) ON ROWS FROM [CubeName] WHERE [Ethnicity].[Hispanic] |
![]() |
| Thread Tools | |
| Display Modes | |
| |