来自https://quartetfs.com/resource-center/mdx-query-basics的示例MDX查询:
SELECT
NON EMPTY {[ASIN].[ASIN].Members} ON ROWS,
NON EMPTY {[Category].[Category].[LCD]} ON COLUMNS
FROM [Amazon]
WHERE ( [Measures].[Gross.Profit],
[Time].[ALL].[AllMember].[2011].[5],
[Brand].[Brand].[LG])
如何在另一列中重复ASIN
字段(粉色列)?
我尝试将[ASIN].[ASIN]
添加到ON COLUMNS
表达式
SELECT
NON EMPTY {[ASIN].[ASIN].Members} ON ROWS,
NON EMPTY {[Category].[Category].[LCD],[ASIN].[ASIN]} ON COLUMNS
FROM [Amazon]
WHERE ( [Measures].[Gross.Profit],
[Time].[ALL].[AllMember].[2011].[5],
[Brand].[Brand].[LG])
导致Two sets specified in the function have different dimensionality.
添加.CurrentMember
导致同样的错误。
我尝试通过新措施添加ASIN属性:
MEMBER Measures.ASIN AS [ASIN].[ASIN].CurrentMember
SELECT
NON EMPTY {[ASIN].[ASIN].Members} ON ROWS,
NON EMPTY {[Category].[Category].[LCD],Measures.ASIN} ON COLUMNS
FROM [Amazon]
WHERE ( [Measures].[Gross.Profit],
[Time].[ALL].[AllMember].[2011].[5],
[Brand].[Brand].[LG])
其中添加了一个包含null
值的新列。
我想看到的是:
______________ LCD ________ ASIN __________
B003D4WAVW 124,420.16 B003D4WAVW
的 ...
有没有办法实现这个目标?
答案 0 :(得分:1)
试试这个:
MEMBER Measures.ASIN AS [ASIN].[ASIN].CurrentMember.Member_Name
MEMBER Measures.LCD AS ([Category].[Category].[LCD],[Measures].[Gross.Profit])
SELECT
NON EMPTY {[ASIN].[ASIN].Members} ON ROWS,
NON EMPTY {[Measures].[LCD],[Measures].[ASIN]} ON COLUMNS
FROM [Amazon]
WHERE ( [Time].[ALL].[AllMember].[2011].[5],
[Brand].[Brand].[LG])
您尝试在同一轴上使用尺寸和测量成员。我把它变成了两个措施。