1 TOPCOUNT
类似的还有BOTTOMCOUNT HEAD TAIL等
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
SELECT [Measures].[Internet Sales Amount] ON 0, TOPCOUNT([Date].[Date].[Date].MEMBERS, 10, [Measures].[Internet Sales Amount]) ON 1 FROM [Adventure Works]
2 ORDER
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
SELECT Measures.[Reseller Order Count] ON COLUMNS, Order( [Date].[Calendar].[Calendar Quarter].MEMBERS ,Measures.[Reseller Order Count] ,DESC ) ON ROWS FROM [Adventure Works]
3 范围运算符(:)
如:04年1月到04年3月
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
{ [Ship Date].[Calendar].[Month].&[2004]&[1] : [Ship Date].[Calendar].[Month].&[2004]&[3] }
4 Aggregate
这个函数可以用来计算时间范围内的累计值
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
WITH MEMBER [Date].[Calendar].[First8Months2003] AS Aggregate( PeriodsToDate( [Date].[Calendar].[Calendar Year], [Date].[Calendar].[Month].[August 2003] ) ) SELECT [Date].[Calendar].[First8Months2003] ON COLUMNS, [Product].[Category].Children ON ROWS FROM [Adventure Works] WHERE [Measures].[Order Quantity]
5 Filter
返回根据搜索条件对指定集进行筛选后得到的集,下面一个类似sql里like的写法
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
with set [ProductType] as filter( [Dim_ProductType].[ProductType].[ProductType], vbamdx!INSTR([Dim_ProductType].[ProductType].CURRENTMEMBER.Name,'U',1>=1) ) select { [Measeures].[ProductCount] } on columns,{ [ProductType] } on rows from [ProductInfo]