0

我对 MDX 查询很陌生。我试图通过我的查询传递一个参数。它给了我这个 SQL 错误:

查询准备失败。
该函数需要一个 5 参数的元组表达式。
使用了元组集表达式。

查询是:

SELECT 
{
[Measures].[DENOMINATOR]
,[Measures].[NUMERATOR]
,[Measures].[Goal]
}
ON COLUMNS,
NON EMPTY
(
 [Dim Indicator].[Indicator Set].[Indicator Set].ALLMEMBERS
 ,[Dim Indicator].[Indicator Group].[Indicator Group].ALLMEMBERS
 ,[Dim Indicator].[Indicator Name].[Indicator Name].ALLMEMBERS
)
ON ROWS
FROM [Dummy-Dashboard]

--Parameter Queries goes here 

WHERE 
(
    strtoset(@DimGenderGenderID)
 )
4

1 回答 1

0

如果您需要使用参数测试您的查询,则需要为此使用 XMLA。请参阅下面的 xmla 示例:

    <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
      <Body>
        <Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
          <Command>
            <Statement>
              Your code in here
            </Statement>
          </Command>
          <Properties>
            <PropertyList xmlns="urn:schemas-microsoft-com:xml-analysis">
              <DataSourceInfo>Provider=MSOLAP;Data Source=local;</DataSourceInfo>
              <Catalog>CubeName</Catalog>
              <Format>Tabular</Format>
              <Content>Data</Content>
              <Timeout>0</Timeout>
            </PropertyList>
          </Properties>
          <Parameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:schemas-microsoft-com:xml-analysis">
            <Parameter>
              <Name>ParameterName</Name>
              <Value xsi:type="xsd:string">ParameterValue</Value>
            </Parameter>
          </Parameters>
        </Execute>
      </Body>
    </Envelope>
于 2012-11-02T15:11:09.487 回答