We are using Mondrian 3.11.0 in our project and we know that sub queries are currently not supported by the Mondrian.
http://jira.pentaho.com/browse/MONDRIAN-980
Since we are using Teleric Pivot grip to visualize the cube and it creates sub query based MDX queries for filtering, we have taken the approach of intercepting the query and change it as below.
Here are few examples of what we are doing. As you can see with complex queries this modification may have potential side effects.
Sharing this to help someone out there having the same issue, and also to get the opinion from the Mondrian experts on the forum on our approach.
-- Original MDX
SELECT NON EMPTY {[Product].[Category].[All Products],[Product].[Category].[All Products].Children} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS
FROM (SELECT ({[Product].[Category].&[4],[Product].[Category].&[1]}) ON 0 FROM [Adventure Works])
WHERE ([Measures].[Reseller Freight Cost])
-- Modified MDX
SELECT NON EMPTY
VisualTotals
({[Product].[Category].[All Products]
,[Product].[Category].&[4],[Product].[Category].&[1]}
, '*'
) DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS
FROM [Adventure Works]
WHERE ([Measures].[Reseller Freight Cost])
-- Original MDX
SELECT NON EMPTY {CROSSJOIN({[Product].[Category].[All Products]},{[Geography].[City].[All Geographies]}),
CROSSJOIN({[Product].[Category].[All Products].Children},{[Geography].[City].[All Geographies]}),
CROSSJOIN({[Product].[Category].[All Products]},{[Geography].[City].[All Geographies].Children})}
DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS FROM (SELECT ({[Product].[Category].&[4],[Product].[Category].&[1]}) ON 0
FROM ( SELECT ({[Geography].[City].&[Abingdon]&[ENG],[Geography].[City].&[Albany]&[OR],[Geography].[City].&[Alexandria]&[NSW],[Geography].[City].&[Alhambra]&[CA],[Geography].[City].&[Alpine]&[CA]}) ON 0
FROM [Adventure Works] ))
WHERE ([Measures].[Reseller Freight Cost])
-- Modified MDX
SELECT NON EMPTY {
CROSSJOIN( VisualTotals
({[Product].[Category].[All Products]
,[Product].[Category].&[4],[Product].[Category].&[1]}
, '*' ), VisualTotals
({[Geography].[City].[All Geographies]
,[Geography].[City].&[Abingdon]&[ENG],[Geography].[City].&[Albany]&[OR],[Geography].[City].&[Alexandria]&[NSW],[Geography].[City].&[Alhambra]&[CA],[Geography].[City].&[Alpine]&[CA]}
, '*' ))
,
CROSSJOIN({[Product].[Category].&[4],[Product].[Category].&[1]},{[Geography].[City].[All Geographies]}),
CROSSJOIN({[Product].[Category].[All Products]}, {[Geography].[City].&[Abingdon]&[ENG],[Geography].[City].&[Albany]&[OR],[Geography].[City].&[Alexandria]&[NSW],[Geography].[City].&[Alhambra]&[CA],[Geography].[City].&[Alpine]&[CA]})
} DIMENSION PROPERTIES CHILDREN_CARDINALITY, PARENT_UNIQUE_NAME ON COLUMNS
FROM [Adventure Works]
WHERE ([Measures].[Reseller Freight Cost])
Thanks in advance.