Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

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



Group: General Forum Members
Last Login: Thursday, November 17, 2016 11:12 AM
Points: 155, Visits: 1,115
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:
{[PC].[Code].Members } on columns,
{[EE].[Em].members} on rows
([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.


Post #1508217
Posted Friday, October 25, 2013 3:55 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 5:32 AM
Points: 1,269, Visits: 2,367
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.

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