Friday, March 30, 2012

Help on understanding generated MDX WHERE clause

When your reporting services datasource is a cube, MDX is generated when you use the design view. In the MDX editor the generated MDX can be viewed. Using parameters I always get a where clause with code like the following:

IIF( STRTOSET(@.OrgLevelname, CONSTRAINED).Count = 1, STRTOSET(@.OrgLevelname, CONSTRAINED), [Organisation].[Level 2 name].currentmember )

I like to understand what is generated. Is there something I can read on the generated WHERE clause (I do understand the generated SELECT and FROM clauses)? Or can someone shed a light on it?

Why does the MDX need to branch on 'Count = 1' In what way does the result slice my data when Count = 1 or when Count <> 1?

Thanks,
Henk

I think this is what Reed Jacobson is talking about here:

http://sqljunkies.com/WebLog/hitachiconsulting/archive/2006/11/06/25176.aspx

To find out more about how subcubes and the Where clause work, see:

http://www.sqljunkies.com/WebLog/mosha/archive/2006/11/23/subselects_sp2.aspx

HTH,

Chris

sql

No comments:

Post a Comment