transpose mdx results => values are lost

假如想象 提交于 2021-02-11 14:17:40

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!