本文共 1670 字,大约阅读时间需要 5 分钟。
记录 SBS 中 MDX 查询原型,供实际项目参考。
SELECT ([Product].[Category].[Bikes],[Measures].[Internet Sales Amount]) ON COLUMNS,NON EMPTY [Customer].[Customer].[Customer].MEMBERS ON ROWSFROM [Step-by-Step]WHERE ([Date].[Calendar].[Date].&[20040102]:[Date].[Calendar].[Date].&[20040301])
SELECT ({([Product].[Category].[Bikes],[Measures].[Internet Sales Amount]),([Product].[Category].[Clothing],[Measures].[Internet Sales Amount])} ON COLUMNS,NON EMPTY [Customer].[Customer].[Customer].MEMBERS ON ROWSFROM ( SELECT ([Date].[Calendar].[Date].&[20040102]:[Date].[Calendar].[Date].&[20040301]) ON COLUMNS FROM [Step-by-Step])
WITH MEMBER [Measures].[CustomerCounts] ASCOUNT(NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Bikes],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember)) + NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Clothing],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember)) )
WITH MEMBER [Measures].[CustomerCounts] ASCOUNT(NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Bikes],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember.FIRSTCHILD)) + NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Clothing],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember.FIRSTCHILD)) )
更多 BI 文章请参看相关链接。
转载地址:http://omyfk.baihongyu.com/