开发者

MDX on multiple hierarchical dimensions

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:

MDX on multiple hierarchical dimensions

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


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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜