使用 SSAS 和 MDX 在列和行上显示不同的维度
您好,我是 SSAS 和 MDX 的新手,我需要生成基于 OLAP 多维数据集的 ssrs 报告。 我不知道如何在列和行上显示不同的维度成员。 维度是列和客户上的评级和时间以及行上的状态,如下所示:
| a rated | b rated | c rated | Year-3 | Year-2 | Year-1 | Year* | Total|
good clients |
medium clients|
bad clients |
total clients |
status 1 |
status 2 |
status 3 |
total status |
----------------------------------------------------------------------------------------
年份对应于当前年份。
如何使用 MDX 实现这一目标?
Hi I'm new to SSAS and MDX and I need to produce a ssrs report based on an OLAP cube.
I can't figure out how to display different dimension members on columns and rows.
The dimensions are rating and time on columns and clients and statuses on rows like this:
| a rated | b rated | c rated | Year-3 | Year-2 | Year-1 | Year* | Total|
good clients |
medium clients|
bad clients |
total clients |
status 1 |
status 2 |
status 3 |
total status |
----------------------------------------------------------------------------------------
Year corresponds to the current year.
How can I achieve this with MDX?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 MDX 中,如果您想将不同维度的成员显示在同一轴上,可以将它们放入元组中。类似:
可能有助于解决您的问题。
in MDX you can put members of different dimensions into a tuple if you want to display them on the same axis. Something like:
may help solve your problem.
MDX SELECT 语句的轴是一组具有相同“维度”的元组。这意味着所有元组必须包含相同维度的成员。因此,您不能按照您的要求拥有由不同维度的成员(成员是一个元组)组成的 MDX 集。
话虽这么说,我不明白:“收视率和时间栏是独立的”。这到底是什么意思?
An axis of an MDX SELECT statement is a set of tuples of same "dimensionality". That means that all tuples must contains the members of the same dimensions. So you cannot have an MDX set made of members (a member is a tuple) of different dimensions as you're requesting.
That being said, I do not understand: "the ratings and the time columns are independent". What does that mean exactly ?
一个 MDX 查询最多可支持 128 个指定轴,但很少有 MDX 查询会使用超过 5 个轴。对于前 5 个轴,可以使用别名 COLUMNS、ROWS、PAGES、SECTIONS 和 CHAPTERS。
尝试使用上述轴来实现您所期望的结果,例如查询两个不同的维度。
An MDX query can support up to 128 specified axes, but very few MDX queries will use more than 5 axes. For the first 5 axes, the aliases COLUMNS, ROWS, PAGES, SECTIONS, and CHAPTERS can instead be used.
Try to use the above axes to achieve what you are expecting like querying two different dimensions.
下面的查询可能适合您。您提到您的多维数据集中没有“所有”成员,因此您需要将查询中的“所有”成员替换为相应的默认成员。我曾尝试在冒险作品中制作类似的情景。单元格有 internetSales 金额
结果如下所示
The query below might work for you. You mentioned you dont have "all" members in your cube, so you need to replace the "all" in the query with respective default members. I have tried to make a similar senario in Adventure works. The cells have internetSales amount
The result looks like below