none
WITH SET referenced in sub-query RRS feed

  • Question

  • Hi

    I am concerned about the size of query (number of bytes) so I am looking at WITH SET as a option to not having long sets appear multiple times in the MDX query.  For example:

     

    WITH SET [Selected DeptIds] AS

     { [Funding Deptid].[DeptId].[260000], [Funding Deptid].[DeptId].[261300] }

    In the MDX I am currently working, the Dept list could be hundreds of Ids and could appear twice in the code.  One list appears in a sub-query.  MDX recognizes the main body reference to [Selected DeptIds] but in the sub-query I get the following:

     

    Query (18, 16) The dimension '[Selected DeptIds]' was not found in the cube when the string, [Selected DeptIds], was parsed.

     

    Any suggestions?
    Friday, September 21, 2007 3:49 PM

Answers

  • I'm pretty sure it's not possible to use sets declared in a WITH clause in a subquery, unfortunately...

     

    Chris

     

    Friday, September 21, 2007 10:16 PM
    Moderator
  • Sad ...

    If the scope of a WITH SET does not drill into sub-query, then it seems to have limited benefit.  The only benefit as I see, is with a global named set defined with a CREATE statement.

    Tuesday, September 25, 2007 2:03 PM

All replies

  • I'm pretty sure it's not possible to use sets declared in a WITH clause in a subquery, unfortunately...

     

    Chris

     

    Friday, September 21, 2007 10:16 PM
    Moderator
  • Sad ...

    If the scope of a WITH SET does not drill into sub-query, then it seems to have limited benefit.  The only benefit as I see, is with a global named set defined with a CREATE statement.

    Tuesday, September 25, 2007 2:03 PM