Sql server 2008 r2 查询(2,2)默认情况下,应为年级别。在MDX查询中的cube.ytd函数中找不到此类级别无效
我使用SSAS和SQLServer2008R2以及AdventureWorks数据库 我写下这个问题:Sql server 2008 r2 查询(2,2)默认情况下,应为年级别。在MDX查询中的cube.ytd函数中找不到此类级别无效,sql-server-2008-r2,ssas,mdx,olap,Sql Server 2008 R2,Ssas,Mdx,Olap,我使用SSAS和SQLServer2008R2以及AdventureWorks数据库 我写下这个问题: Select ytd([Date].[Calendar].[Calendar Quarter].[Q3 CY 2003]) on columns From [Adventure Works] 我得到了这个结果: 但当我执行此查询时: Select ytd([Date].[Fiscal].[Fiscal Quarter].[Q3 FY 2003]) on columns From [Adve
Select
ytd([Date].[Calendar].[Calendar Quarter].[Q3 CY 2003]) on columns
From [Adventure Works]
我得到了这个结果:
但当我执行此查询时:
Select
ytd([Date].[Fiscal].[Fiscal Quarter].[Q3 FY 2003]) on columns
From [Adventure Works]
我得到这个错误:
Executing the query ...
Query (2, 2) By default, a year level was expected. No such level was found in the cube.
Execution complete
为什么此查询不起作用?来自:Ytd函数是PeriodsToDate[…]的快捷函数。请注意,当Type属性设置为FiscalYears时,此函数将不起作用。不如改用以下方法:
Select
PeriodsToDate(
[Date].[Fiscal].[Fiscal Year],
[Date].[Fiscal].[Fiscal Quarter].[Q3 FY 2003]
) on columns
From [Adventure Works]