Openquery on OLAP data source -
11-07-2003
, 06:27 AM
From Query Analyser, I can run an MDX query on my OLAP
cube, but I miss the syntax to specify the columns in the
resulting recordset. Could you guys help me?
I cannot figure out how to specify the column [Measures].
[Net Sales] in the SELECT statement. Instead of "SELECT
a.* ", I want some sort of "SELECT a.[Measures].[Net
Sales]"
The query returns:
[Time].[Marketing].[Year].[MEMBER_CAPTION] [Measures].[Net
Sales]
------------------------------------------ ----------------
------
Current 30954618.01
(1 row(s) affected)
SELECT a.*
FROM OPENROWSET('MSOLAP',
'Data Source=SERVER;Initial Catalog=AnDB;Integrated
Security=SSPI',
'
select
{([Measures].[Net Sales]) } on columns,
{([Time.Marketing].[Year].[Current] )} on rows
from [Item Sale]') AS a |