DateFrom
和
DateTo
报告中的一个数据集是MDX数据集。我用
strtoset
将日期范围提供给它,并将参数的表达式提供给
stroset
去:
="([Test Run].[Complete Date Hierarchy By Month].[Date].&[" & Format(Parameters!FromDate.Value, "yyyy-MM-dd") & "T00:00:00]:[Test Run].[Complete Date Hierarchy By Month].[Date].&[" & Format(Parameters!ToDate.Value, "yyyy-MM-dd") & "T00:00:00])"
问题是,如果开始日期和结束日期不是维度中的成员,查询将返回所有空值。
是否有任何方法可以将用户提供的日期调整为维度中最近的现有成员,向前(对于From)或向后(对于to)?
strtoset()
. 现在Where条款中有以下内容:
filter([Test Run].[Complete Date Hierarchy By Month].[Date],
[Test Run].[Complete Date Hierarchy By Month].currentmember.member_value >= CDate('2017-10-01') and
[Test Run].[Complete Date Hierarchy By Month].currentmember.member_value < CDate('2018-07-01'))