在 mondrian 上使用不同计数,但仍然出现重复
有疑问
我对 mondrian 我的事实表
customer | regionid | customertype | productsold
------------------------------------------------
A | 1 | T1 | P1
A | 1 | T1 | P2
A | 1 | T1 | P3
B | 2 | T1 | P1
B | 2 | T1 | P2
C | 1 | T2 | P1
C | 1 | T2 | P2
C | 1 | T2 | P3
C | 1 | T2 | P4
... so on
地区 维度
regionid | state | district | subdistrict
-----------------------------------------
CustomerType 维度
customertype | name | more column
----------------------------------
ProductSold 维度
productsold | name | more column
--------------------------------
每个客户都有 1 一对多关系,
与地区和客户类型的一对一关系,以及与productsold我的MDX查询的
select
{[Measures].[CustomerCount]} on columns,
{([Region].[AllRegion], [CustomerTypes].[AllCustomerTypes],
[ProductSold].[AllProductSold])} on rows
from [Customers]
就像我为CustomerCount配置的不同计数 一样,但结果仍然是重复的。
<Measure name="CustomerCount" column="Customer" aggregator="distinct-count" visible="true">
任何建议表示赞赏。谢谢。
i have a question regarding mondrian
My facts table
customer | regionid | customertype | productsold
------------------------------------------------
A | 1 | T1 | P1
A | 1 | T1 | P2
A | 1 | T1 | P3
B | 2 | T1 | P1
B | 2 | T1 | P2
C | 1 | T2 | P1
C | 1 | T2 | P2
C | 1 | T2 | P3
C | 1 | T2 | P4
... so on
Region dimension
regionid | state | district | subdistrict
-----------------------------------------
CustomerType dimension
customertype | name | more column
----------------------------------
ProductSold dimension
productsold | name | more column
--------------------------------
Each customer have 1 to 1 relation with region and customertype, and 1 to many with productsold
my MDX query like
select
{[Measures].[CustomerCount]} on columns,
{([Region].[AllRegion], [CustomerTypes].[AllCustomerTypes],
[ProductSold].[AllProductSold])} on rows
from [Customers]
I configured distinct-count for CustomerCount, but still the result is duplicate.
<Measure name="CustomerCount" column="Customer" aggregator="distinct-count" visible="true">
Any advice appreciate. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我希望您的 MDX 语句仅返回一个单元格(包含不同的计数 3),因为您的行轴包含每个维度的 All 成员。
我建议您在 Mondrian 中启用 SQL 日志记录并检查 Segment.load 查询,因为它应该是一个非常简单的 SQL 语句来返回不同的客户计数。
Mondrian 9.3 及更高版本使用 log4j2,因此请参阅此示例进行配置: https://github.com/pentaho/mondrian/blob/master/mondrian/src/it/resources/log4j2.xml
之前的版本Mondrian 仍然使用 log4j1.2 所以请参阅此示例进行配置:
https://github.com/ pentaho/mondrian/blob/9.1.0.0/mondrian/src/it/resources/log4j.xml
I would have expected your MDX statement to return just a single cell (containing the distinct count of 3) since your rows axis includes the All member from each dimension.
I would suggest you enable SQL logging in Mondrian and check the Segment.load query since it should be a pretty simple SQL statement to return the distinct count of Customers.
Mondrian 9.3 and onwards uses log4j2 so see this example for configuration: https://github.com/pentaho/mondrian/blob/master/mondrian/src/it/resources/log4j2.xml
Prior versions of Mondrian still use log4j1.2 so see this example for configuration:
https://github.com/pentaho/mondrian/blob/9.1.0.0/mondrian/src/it/resources/log4j.xml