2016-05-30 86 views
0

我可以使用T-SQL,但對於MDX來說非常新手。我有低於該查詢輸出像MDX:爲列設置別名

Age European | ParameterCaption | ParameterValue | ParameterLevel 
----------------------------------------------------------------- 
XXX   | XXX    | XXX   | XXX 

然而,我想Age European讀取的東西我指定例如The Age。有任何想法嗎?下面的代碼:

WITH MEMBER [Measures].[ParameterCaption] AS 
    IIf (
     ([Age At Activity].[Age European].CurrentMember .Member_Caption) = "1 - 4", "01 - 04", 
    IIf ([Age At Activity].[Age European].CurrentMember .Member_Caption = "5 - 9", "05 - 09", [Age At Activity].[Age European].CurrentMember .Member_Caption) 
    ) 
MEMBER [Measures].[ParameterValue] AS 
    [Age At Activity].[Age European].CurrentMember.UniqueName 
MEMBER [Measures].[ParameterLevel] AS 
    [Age At Activity].[Age European].CurrentMember .Level .Ordinal 
SELECT 
{ [Measures].[ParameterCaption], [Measures].[ParameterValue], [Measures].[ParameterLevel] } ON COLUMNS, 
Order ([Age At Activity].[Age European].[Age European].Members, [Measures].[ParameterCaption], BASC) ON ROWS 
FROM ReportingPBR 
+0

你已經有了'ParameterValue'?爲什麼不重新命名爲「The Age」 – whytheq

+1

嘗試更改SSRS自身的列名稱。 – SouravA

+0

@SouravA我真的不明白這個問題。 – whytheq

回答

0

只需添加此列:

MEMBER [Measures].[The Age] AS 
    [Age At Activity].[Age European].CURRENTMEMBER.MEMBER_CAPTION