多个层次结构维度上的MDX [英] MDX on multiple hierarchical dimensions

查看:96
本文介绍了多个层次结构维度上的MDX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在多维数据集上定义了2个层次结构维度(用于位置和时间).我的问题是编写单个MDX查询以检索以下结构的可能性.我的意思是编写一个查询以获取值V1,V2,V3和V4:

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查询.只是想知道MDX中是否有一些神奇的语法.

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

推荐答案

尝试:

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

这篇关于多个层次结构维度上的MDX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆