[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 552
  • Last Modified:

Complex MDX Named Set

I have MDX query shown in the code section.
It is giving me The set of tuples (graphic attached)

What I'd like to do is Transform this query into a named set.

Basically i'm trying to find out if there is a way do use the WHERE key word inside of the Named set...
SELECT {} ON 0,
[School Agencies].[DISTRICT NAME].Members ON 1 FROM STUDENT
WHERE ({
[School Agencies].[AGENCY ID].&[28-0001-000],
[School Agencies].[AGENCY ID].&[28-0017-000],
[School Agencies].[AGENCY ID].&[55-0001-000]
})

Open in new window

screenshot.jpg
0
the_bachelor
Asked:
the_bachelor
1 Solution
 
Megan BrooksSQL Server ConsultantCommented:
I am just coming up to speed with MDX myself, but it seems like you could in effect move the WHERE restriction into the row axis set, something like the example below. I tried this with a similar query against one of my own cubes and it seemed to work.
The exists relates the row output set to the filtering (School Agencies) set without including the latter in the output.

SELECT {} ON 0,
Exists([School Agencies].[DISTRICT NAME].Members, 
{
[School Agencies].[AGENCY ID].&[28-0001-000],
[School Agencies].[AGENCY ID].&[28-0017-000],
[School Agencies].[AGENCY ID].&[55-0001-000]
}) ON 1 FROM STUDENT

Open in new window

0
 
the_bachelorAuthor Commented:
'tis what i needed.
short & sweet.
thanks
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now