MDX on multiple hierarchical dimensions

流过昼夜 提交于 2019-12-11 23:17:19

问题


2 hierarchical dimensions (for location and time) are defined on a cube. My question is about possibility of writing a single MDX query for retrieving following structure. I mean writing a single query for obtaining values V1, V2, V3 and V4:

The obvious way is to use multiple MDX queries. Just wondering if there is some magic syntax in MDX.


回答1:


Try:

SELECT
{
    [Measures].[Some Measure]
} ON 0,
{
    [Location].[Level 1].[Level 1].Members*
    [Date].[Year].[Year].Members*
    [Location].[Level 2].[Level 2].Members
} ON 1
FROM [Your Cube]

You can also get the totals with:

SELECT
{
    [Measures].[Some Measure]
} ON 0,
{
    [Location].[Level 1].Members*
    [Date].[Year].Members*
    [Location].[Level 2].[Level 2].Members
} ON 1
FROM [Your Cube]

No magic here - just crossjoining the attribute hierarchies as needed. Please note that if you place the two Location hierarchies next to each other the excution will be faster.

No idea if this completely answers your question but at least may help a bit...



来源:https://stackoverflow.com/questions/6268451/mdx-on-multiple-hierarchical-dimensions

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