当前位置: 代码迷 >> 数据仓库 >> 如何在仓库中实现序号排名有关问题
  详细解决方案

如何在仓库中实现序号排名有关问题

热度:149   发布时间:2016-05-05 16:12:35.0
怎么在仓库中实现序号排名问题
我在展示的仓库中加一个序号
可以按值排,也可以按名位置排名
我在CUBE中找到模板有 按位置排名,和按值排名
其中按位置模板如下:

Rank
(
  [<<Dimension>>].[<<Hierarchy>>].CurrentMember,
  <<Ranking Set>>
)

// Returns the rank of the tuple within the set, 
// where the rank is based on the position of the tuple within the set.

但是这个没有具体例子,不知道具体怎么写
大家谁作过这方面的东西,请教
多谢了

------解决方案--------------------
排序 
函数:Order
对各个产品类别按照Store Sales指标降序排列,排序分为维内排序/整体排序。 
select {[Measures].[Unit Sales], [Measures].[Store Sales]} on columns,

Order([Product].[Product Department].members, [Measures].[Store Sales], DESC) on rows

from Sales
------解决方案--------------------
例如:将 1997 年中月度[Measures].[Store Sales]的排序.

SQL code
WITH  SET [BBB] AS 'Order( Descendants([Time].[1997],2),[Measures].[Store Sales],BDESC )'Member Measures.[序] As 'Rank( [Time].[TIME].CurrentMember,[BBB] )' SELECT {[Measures].[Store Sales], Measures.[序] } ON COLUMNS ,         { [BBB] } ON ROWS FROM [Sales and Employees]
------解决方案--------------------
推荐个实用的数据仓库工具吧,我用oracle比较多经常需要抽取大量数据
  相关解决方案