Ssas 使用过滤器限制日期范围
如果不使用冒号运算符,如何将集合Ssas 使用过滤器限制日期范围,ssas,mdx,olap,Ssas,Mdx,Olap,如果不使用冒号运算符,如何将集合AllDates过滤到2005年1月5日到2006年1月10日 WITH SET [AllDates] AS [Date].[Date].[Date].MEMBERS MEMBER [Measures].[DTkey] AS [Date].[Date].CurrentMember.Member_Key MEMBER [Measures].[DTmemValue] AS [Date].[Date].CurrentMem
AllDates
过滤到2005年1月5日到2006年1月10日
WITH
SET [AllDates] AS
[Date].[Date].[Date].MEMBERS
MEMBER [Measures].[DTkey] AS
[Date].[Date].CurrentMember.Member_Key
MEMBER [Measures].[DTmemValue] AS
[Date].[Date].CurrentMember.MemberValue
MEMBER [Measures].[DTvalue] AS
[Date].[Date].CurrentMember.Value
SELECT
{[Measures].[DTmemValue]} ON 0
,Filter
(
[AllDates]
,
[Measures].[DTmemValue] > 0
) ON 1
FROM [Adventure Works];
有关MDX筛选的更多详细信息可以找到:我没有Adv-Wks,但在我的上测试了以下内容,效果很好 这就是你要找的吗
WITH
SET [AllDates] AS
[Date].[date].[date].members
MEMBER [Measures].[DTkey] AS
[Date].[date].CurrentMember.Member_Key
MEMBER [Measures].[DTmemValue] AS
[Date].[date].CurrentMember.MemberValue
MEMBER [Measures].[DTvalue] AS
[Date].[date].CurrentMember.Value
SELECT
{[Measures].[DTmemValue]} ON 0
,Filter
(
[AllDates]
,
CDate([Measures].[DTmemValue]) >= CDate("01/05/2005")
and CDate([Measures].[DTmemValue]) <= CDate("01/10/2006")
) ON 1
FROM [Adventure Works];
与
将[所有日期]设置为
[日期][日期][日期][日期].成员
成员[度量][DTkey]为
[日期][日期].CurrentMember.Member\u密钥
成员[Measures].[DTmemValue]AS
[Date][Date].CurrentMember.MemberValue
成员[Measures].[DTvalue]AS
[日期][日期].CurrentMember.Value
挑选
0上的{[Measures].[DTmemValue]}
,过滤器
(
[所有日期]
,
CDate([Measures].[DTmemValue])>=CDate(“01/05/2005”)
和CDate([Measures].[DTmemValue])逗号分隔的成员?@TabAlleman ok-公正的评论:我已经修正了这个问题!使用冒号有什么问题?@BIDude没什么问题-范围运算符很可爱-只是想知道不使用冒号这是否可行我的快速谷歌搜索没有带来任何替代性的内容Shi sourav-我知道这是可能的。
WITH
SET [AllDates] AS
[Date].[date].[date].members
MEMBER [Measures].[DTkey] AS
[Date].[date].CurrentMember.Member_Key
MEMBER [Measures].[DTmemValue] AS
[Date].[date].CurrentMember.MemberValue
MEMBER [Measures].[DTvalue] AS
[Date].[date].CurrentMember.Value
SELECT
{[Measures].[DTmemValue]} ON 0
,Filter
(
[AllDates]
,
CDate([Measures].[DTmemValue]) >= CDate("01/05/2005")
and CDate([Measures].[DTmemValue]) <= CDate("01/10/2006")
) ON 1
FROM [Adventure Works];