Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

MDX Query where value is greater than Expand / Collapse
Author
Message
Posted Thursday, October 24, 2013 12:28 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, August 21, 2014 1:55 PM
Points: 149, Visits: 1,027
I'm a newb to MDX queries and I am just getting started with the concepts. I know that I am supposed to forget what I know about SQL since the structure of MDX is completely different.

To that end, I'm trying to run a pretty simple query, but I'm kind of hung up on the concept of a WHERE clause and Tuples. I get the data on the intersection of the cube, but then I want to limit it to a specific value for one member in one of the measures.

Here's my query:
SELECT 
{[PC].[Code].Members } on columns,
{[EE].[Em].members} on rows
from
[Cube]
where
([PC].[Code].&[Reg1]) > 200

If I get rid of the WHERE the query runs, but I see all of the data. In this case, I only want to see where there is a value of 200 or greater for Reg1. All of the members would show, but only when the WHERE condition was met.

I hope I'm giving enough information.


Regards,

Irish
Post #1508217
Posted Friday, October 25, 2013 3:55 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 9:54 AM
Points: 557, Visits: 1,074
What you have to have in mind about the WHERE clause in MDX is that in it you are supplying the context for the query (I think originally it was CONTEXT rather than WHERE). So it's not like the SQL WHERE something IS something.

With that in mind have a look into the FILTER function and you should be able to achieve what you need to.

http://technet.microsoft.com/en-us/library/ms146037.aspx

I could write the query for you but I think it stays with you better if you learn it yourself

Best of luck.





I'm on LinkedIn
Post #1508388
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse