MDX 查询比较不同年份
我是 MDX 新手,想知道是否可以创建一个查询,在两个不同的轴上显示每年和每月的销售额,即使销售日期是单个维度。
类似于:
Sales | 2010 | 2011 | Diff
---------+-----------+------------+----------
Jan | 1234,00 | 2345,10 | +80%
Feb | ...
...
编辑: 将 mondrian 添加到标签中,因为似乎有 mondrian 中不可用的其他 MDX 实现的可能性。
I am new to MDX and wondered if it is possible to create a query that shows a Sales amount per Year and per Month on two different axes, even if the sales date is a single dimension.
Something like:
Sales | 2010 | 2011 | Diff
---------+-----------+------------+----------
Jan | 1234,00 | 2345,10 | +80%
Feb | ...
...
EDIT: Added mondrian to tags, because there seem to be possibilities with other MDX implementations not available in mondrian.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,解决方案是围绕 计算成员 :
让我们想象一下您的初始 MDX 看起来像:
您可以在 [Year] 层次结构中添加计算成员 :
您还可以使用 实用或统计维度。这些维度而不是保存数据定义转换/函数,并且输出将不完全是您正在寻找的,但这是一个有趣的概念。
Yes the solution is around calculated members :
Let's imagine your initial MDX looks like :
You can add a calculated member in the [Year] hierarchy :
You can also add a more elegant and flexible solution, by using utility or statistical dimensions. Those dimension instead of holding data define transformations / functions and the output will not be exactly the one you're looking, but it's an interesting concept.
该问题可以通过 ParallelPeriod 函数解决:
The problem can be solved with the ParallelPeriod function: