MDX结果分类
我是 mdx 的新手,现在已经尝试解决以下问题大约一天了。任何帮助将不胜感激:
我的查询:
select {[Measures].[Kunden]} ON COLUMNS,
NON EMPTY Hierarchize(Union({CurrentDateMember([dimZeit], "[\di\mZeit]
\.[yyyy]"), CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]").Children},
CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]\.[q]").Children))) ON ROWS
FROM Center
它给出了以下结果,如预期:
Zeit Kunden
2010 1561
- Q1 523
- Q2 470
- Q3 256
- Q4 312
- Nov. 312
现在,我想要实现的是将列“Kunden”拆分为列“Kunden <” 5分钟'和'Kunden> 5min’指等待时间少于或超过5分钟的顾客。
我能得到的最接近结果如下:
WITH
MEMBER [Measures].[LT5] AS
Aggregate(
Filter([Measures].[Kunden], [Measures].[Wartezeit] < 3000))
select {[Measures].[LT5]} ON COLUMNS,
NON EMPTY Hierarchize(Union({CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]"),
CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]").Children},
CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]\.[q]").Children)) ON ROWS
FROM Center
结果是:
Zeit Kunden
2010 -
- Q1 75
- Q2 23
- Q3 86
- Q4 71
- Nov. 71
我理解其原因是,因为 2010 年全年的合计 [Measure].[Wartezeit] 超过 3000 秒。但我希望看到等待时间低于 3000 秒的客户数量,因此 2010 年应该是 75+23+86+71 = 255。
I'm new to mdx and have been trying to solve the following problem for about a day now. Any help would be appreciated:
My Query:
select {[Measures].[Kunden]} ON COLUMNS,
NON EMPTY Hierarchize(Union({CurrentDateMember([dimZeit], "[\di\mZeit]
\.[yyyy]"), CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]").Children},
CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]\.[q]").Children))) ON ROWS
FROM Center
which gives the following result, as expected:
Zeit Kunden
2010 1561
- Q1 523
- Q2 470
- Q3 256
- Q4 312
- Nov. 312
Now, what I want to achieve is to split the column 'Kunden' into columns 'Kunden < 5 min' and 'Kunden > 5min' which means customers who have waited for less or more than 5 minutes.
The closest I could get was the following:
WITH
MEMBER [Measures].[LT5] AS
Aggregate(
Filter([Measures].[Kunden], [Measures].[Wartezeit] < 3000))
select {[Measures].[LT5]} ON COLUMNS,
NON EMPTY Hierarchize(Union({CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]"),
CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]").Children},
CurrentDateMember([dimZeit], "[\di\mZeit]\.[yyyy]\.[q]").Children)) ON ROWS
FROM Center
The result is:
Zeit Kunden
2010 -
- Q1 75
- Q2 23
- Q3 86
- Q4 71
- Nov. 71
I understand the cause for this is, because the aggregated [Measure].[Wartezeit] for the whole year 2010 is above 3000 seconds. But I'd like to see the amount of customers with a waiting time below 3000 seconds, so it should be 75+23+86+71 = 255 for 2010.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过在 wartezeit 列上创建一个退化维度来解决这个问题,在 mondrian 中如下所示:
我的查询的 select 子句现在是一个简单的交叉联接:
Solved it by creating a degenerated dimension on the wartezeit column that looks like this in mondrian:
The select clause of my query is now a simple crossjoin: