我想计算特定时间范围的工作日,然后找到平均每日调度。目前时间范围是WHERE语句。 我相信我已将日期范围包含在第一位会员中,但我无法计算如何计算一个月范围内的日期。 有什么建议吗?
WITH MEMBER [Measures].[Working Days] AS
COUNT(Date.[Working Date].&[1])--Doesn't work
MEMBER [Measures].[Average Daily Dispatches] AS
[Measures].[Total Dispatches]/[Measures].[Working Days]
SELECT [Measures].[Average Daily Dispatches] ON 0
FROM [cube]
WHERE (
[Date].[Month].&[2015-01-01T00:00:00]:[Date].[Month].&[2015-08-01T00:00:00]
);
答案 0 :(得分:0)
使用NonEmpty
函数生成发送日期的工作日期。然后在此基础上使用COUNT
。
WITH MEMBER [Measures].[Working Days] AS
COUNT
(
NonEmpty
(
[Date].[Working Date].MEMBERS,
[Measures].[Total Dispatches]
)
)