locked
How to create a dynamic query for the following query.. RRS feed

  • Question

  • Hi,

     I tried creating the dynamic MDX query for the following Basic MDX query by viewing the examples given in websites. But it's always showing an error.

     Basic MDX Query is:

     WITH MEMBER MEASURES.COUNTTUPLE AS
    COUNT(([Agent_State].[Phys St Abbr]))
    SELECT MEASURES.COUNTTUPLE ON 0
    FROM [Cube Name]

    Dynamic MDX Query which I tried is:

    WITH MEMBER MEASURES.COUNTTUPLE AS
    COUNT(([Agent_State].[Phys St Abbr]))
    SELECT * FROM OPENROWSET('MSOLAP','Data Source=.........., Initial Catalog=.........;',

    'SELECT MEASURES.COUNTTUPLE ON 0
    FROM [Cube Name]')

    Error which Iam receiving is :

    Query (3, 15) Parser: The syntax for 'OpenRowset' is incorrect.

    Kindly please give me the exact dynamic MDX query for the above basic MDX query

     Thanks & Regards,

    Jayanth. J

     

    Thursday, May 17, 2012 3:08 AM

Answers

All replies