请你帮忙。我使用以下表达式来获取上个月同一周的流入量。
([Time].[Week Commencing Date].CurrentMember.PrevMember, [Measures].[_Inflow])
这似乎正在返回结果,但是缺少总计,因为这会将周数相加并将值分配到月年总计中。
如果我在时间维度中选择 Month Year,则不会得到任何结果。
你能告诉我一个例子,我可以如何更正表达式。
我已尝试[Time].[Time].CurrentMember.PrevMember, [Measures].[_Inflow]
使其使用时间层次结构,但这不起作用。
时间维度 - 属性:月年、季度、周开始日期 - 时间(层次结构):年、季度、月年、周开始日期
任何帮助,将不胜感激。谢谢你。
你需要使用 Cousin 函数。看看下面的例子,我手头的示例立方体在层次结构中没有周,因此我使用日期。在此示例中,我试图获取上个月的相同日期。
select
{[Date].[Calendar].[Date].&[20130922],
cousin([Date].[Calendar].[Date].&[20130922],[Date].[Calendar].[Month].&[2013]&[8])
}
on columns,
[Measures].[Internet Sales Amount]
on rows from
[adventure works]
日期 UserHierarchy 是 Year-Semester-Quate-Month-Date
编辑:使用 Cousin 作为计算成员
要将表亲函数用作计算成员,您需要执行以下操作。但请确保您在查询中使用了日期部分。
select
{[Date].[Calendar].[Date].&[20130922],
cousin([Date].[Calendar].[Date].&[20130922],[Date].[Calendar].[Month].&[2013]&[8])
}
on columns,
[Measures].[Internet Sales Amount]
on rows from
[adventure works]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句