0
Dears:發行訂購MDX查詢結果
我有以下MDX查詢。
WITH
MEMBER [Measures].[Member Full Path] AS
[Revenuedim_Client].CurrentMember.UniqueName
MEMBER [Measures].[Member Ordinal] AS
[Revenuedim_Client].CurrentMember.Ordinal
SELECT
NON EMPTY
Hierarchize(
Union(
Crossjoin([Measures].[BeaconAmount_USD] ,
LastPeriods(12,[Date.YQM].lastChild.lastChild.lastChild)
)
,
Crossjoin({[Measures].[Member Ordinal], [Measures].[Member Full Path]},[Date.YQM].[2018])
)
,POST) ON COLUMNS,
TOGGLEDRILLSTATE(
TOGGLEDRILLSTATE(
TOGGLEDRILLSTATE(
TOGGLEDRILLSTATE(
{[Revenuedim_Client].[All Clients] } ,
{[Revenuedim_Client].[All Clients] }
)
, {[Revenuedim_Client].[Group Client - Altria Group Inc.] }
), {}
), {}
) ON ROWS from [Revenue_Client]
這給我的輸出如下:
在行:客戶端(有4個級別向下鑽取最多項目級別) 在列:12個月+在電池滿員路徑 列:收入
查詢可以如何或在哪裏添加ORDER語句,以便根據12個月的總收入和大多數收入太少的收入對行進行排序,對於Revenuedim_client中的每個4個級別層次?
訂單定義在這裏:https://docs.microsoft.com/en-us/sql/mdx/order-mdx ...你是否嘗試過應用它? – whytheq
事實上,它是如此簡單:\t'ORDER( \t \t \t TOGGLEDRILLSTATE( \t \t \t \t TOGGLEDRILLSTATE( \t \t \t \t \t TOGGLEDRILLSTATE( \t \t \t \t \t \t TOGGLEDRILLSTATE( \t \t \t \t \t {[Revenuedim_Client]。[全部C lients]}, \t \t {$ {param_level1_m}} \t \t) \t \t,{$ {param_level2_m}} \t),{$ {param_level3_m}} \t),{$ {param_level4_m}} ) ,[措施]。 $ {MarketOrBeacon}, DESC)' – user1186098