Fm中表之间的几种关系

0
今天研究了一下,发现了一个问题,先上图再说

QQ图片20130729162816.jpg

如图,这里面的关系有1:1 1:n 0:n 0:1,下面有关系影响的描述,一个纬度表和事实表,最贴切的关系就是做外连接的关系,按照关系影响上的描述,应该是事实表0:n 维度表1:1,但是突然不经意的几个操作让我发现了这样的问题

通过多次实验发现,当基数中不含0的时候,我们从报表中截取的sql显示始终是内连接的关系,当有一个基数是0的时候,不管是0:n或者是0:1,他们的关系都会变成基数没0边的表左外连接基数有0边的表,尽管关系影响的描述可能完全和实际业务不相符

或许这是一个bug%>_<%

补充:今天又试验了一下,发现我上面写得是适用于表模型的,在dmr模型中,当我吧关系选择成1:1 1:1的时候,维度里面的字段和度量拖到一张表里的时候,度量不汇总,但是我吧关系改成1:1 1:n的时候,就按照维度汇总了,这说明了,这两种关系是不一样的在dmr模型中!
已邀请:
1

曾力 - 深处互联网四大坑当中~ 2013-07-29 回答

Cardinality in Generated Queries
IBM Cognos 8 supports both minimum-maximum cardinality and optional cardinality.

In 0:1, 0 is the minimum cardinality, 1 is the maximum cardinality.

In 1:n , 1 is the minimum cardinality, n is the maximum cardinality.

A relationship with cardinality specified as 1:1 to 1:n is commonly referred to as 1 to n when focusing on the maximum cardinalities.

A minimum cardinality of 0 indicates that the relationship is optional. You specify a minimum cardinality of 0 if you want the query to retain the information on the other side of the relationship in the absence of a match. For example, a relationship between customer and actual sales may be specified as 1:1 to 0:n. This indicates that reports will show the requested customer information even though there may not be any sales data present.

Therefore a 1 to n relationship can also be specified as:

0:1 to 0:n

0:1 to 1:n

1:1 to 0:n

1:1 to 1:n
0

Chain_zhou - God 2013-07-30 回答

1:1 1:1 也会汇总,不过会单条数据汇总,但从数据上是看不出来的.
1:1 1:n 也会汇总,多条数据汇总,从数据容易看出来。

要回复问题请先登录注册