本文介绍了MDX ORDER乘以小数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有下一个MDX查询

Suppose that i have next MDX query

select 
{
   [Measures].[Measure1],
   [Measures].[Measure2],
} on columns,
{   
   ORDER([Dim].Children, [Measures].[Measure1], desc)
} on rows
from [Cube]

选择两个度量并按第一个对行进行排序.怎样才能按两个度量进行排序,首先按Measure1进行排序,然后按Measure2进行排序?

which selects two measures and sorts rows by first one.How can sort by two measures, frist sort by Measure1 and then sort by Measure2?

推荐答案

这对我的AdvWrks有效:

This works on AdvWrks for me:

SELECT 
  {
    [Measures].[Reseller Order Quantity]
   ,[Measures].[Reseller Sales Amount]
  } ON 0
 ,Order
  (
    Order
    (
      [Product].[Product].[Product].MEMBERS
     ,[Measures].[Reseller Sales Amount]
     ,BDESC
    )
   ,[Measures].[Reseller Order Quantity]
   ,BDESC
  ) ON 1
FROM [Adventure Works];

也许您需要调换订单并使用BDESC:

Maybe you need to swap the order around and use BDESC:

SELECT 
  {
    [Measures].[Measure1]
   ,[Measures].[Measure2]
  } ON COLUMNS
 ,{
    Order
    (
      Order
      (
        [Dim].Children
       ,[Measures].[Measure2]
       ,BDESC
      )
     ,[Measures].[Measure1]
     ,BDESC
    )
  } ON ROWS
FROM [Cube];

这篇关于MDX ORDER乘以小数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-26 20:21