[英]MDX Filter by Members
This is more of a general MDX question. 这更多是一个一般的MDX问题。 I want to filter those dates from the reporting date.fiscal hierarcy. 我想从报告date.fiscal层次中过滤这些日期。 I was previously using a calculated member but I just put it in the query, it doesnt return any results. 我以前使用的是计算所得成员,但我只是将其放入查询中,它不返回任何结果。
SELECT
{
FILTER (
[Reporting Date].[Fiscal].MEMBERS
,[Reporting Date].[Fiscal].currentmember > [Reporting Date].[Fiscal].[Date].&[2013-03-06]
AND
[Reporting Date].[Fiscal].currentmember < [Reporting Date].[Fiscal].[Date].&[2013-03-11]
)
} on 1
,
{
Measures.Gross
} on 0
FROM [Revenue]
This expression is actually evaluating 2 tuples and then perform the comparison on the evaluated value: 该表达式实际上是在评估2个元组,然后对评估值进行比较:
[Reporting Date].[Fiscal].currentmember > [Reporting Date].[Fiscal].[Date].&[2013-03-06] [报告日期]。[财政]。现任会员> [报告日期]。[财政]。[日期]。&[2013-03-06]
is : 是:
( [Reporting Date].[Fiscal].currentmember ) > ( [Reporting Date].[Fiscal].[Date].&[2013-03-06] ) ([报告日期]。[财政] .currentmember)>([报告日期]。[财政]。[日期]。&[2013-03-06])
where the () represent a tuple (ie, reference to a cell in the cube). 其中()代表元组(即,引用多维数据集中的一个单元格)。 So you're comparing the cell value and not the member dates. 因此,您是在比较单元格值而不是成员日期。 I guess what you want is someting like: 我想你想要的是某种东西:
select ... {[Reporting Date].[Fiscal].[Date].&[2013-03-06] : [Reporting Date].[Fiscal].[Date].&[2013-03-11] } on 1 选择...上的... [[报告日期]。[财政]。[日期]。&[2013-03-06]:[报告日期]。[财政]。[日期]。&[2013-03-11]} 1
You can use the MDX range operator :
to specify a literal member range 您可以使用MDX范围运算符:
指定文字成员范围
SELECT
{ Measures.Gross } ON 0,
{[Reporting Date].[Fiscal].[Date].&[2013-03-06] : [Reporting Date].[Fiscal].[Date].&[2013-03-11] } ON 1
FROM [Revenue]
See documentation here: http://msdn.microsoft.com/en-us/library/ms146001.aspx 请参阅此处的文档: http : //msdn.microsoft.com/zh-cn/library/ms146001.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.