问题
I created an MDX query with some named calculus (using 'WITH' keyword). The last part is:
SELECT
{[Measures].[PCT0p02],[Measures].[PCT0p2],[Measures].[PCT0p5],[Measures].[PCT0p8],[Measures].[PCT0p98]} on 0
FROM [My cube]
It gives me this:
I would like to transpose these results in order to feed an SSRS report.
But write
SELECT
{ } on 0,
{ [Measures].[PCT0p02],[Measures].[PCT0p2],[Measures].[PCT0p5],[Measures].[PCT0p8],[Measures].
[PCT0p98] } on 1
FROM [My cube]
returns
Please tell me how not to lose the value
EDIT: The answer given works, but when I try to use it in SSRS I get an error: it complains that a measure is needed in the columns axis:
回答1:
You need to have something in your 0 axis to satisfy MDX, however you dont want it to modify your result. Defaultmember will help with this.. Example lets say you have a dimension DimA, within DimA you have an attribute AT1, then your query will be
SELECT
{ DimA.AT1.Defaultmember } on 0,
{ [Measures].[PCT0p02],[Measures].[PCT0p2],[Measures].[PCT0p5],[Measures].[PCT0p8],[Measures].
[PCT0p98] } on 1
FROM [My cube]
来源:https://stackoverflow.com/questions/65359513/transpose-mdx-results-values-are-lost