FW - Determinants

来源:互联网 发布:微信打开淘宝链接代码 编辑:程序博客网 时间:2024/04/19 17:06

Determinants

Determinants reflect granularity by representing subsets or groups of data in a query subject and are used to ensure correct aggregation of this repeated data. Determinants are most closely related to the concept of keys and indexes in the data source and are imported based on unique key and index information in the data source. We recommend that you always review the determinants that are imported and, if necessary, modify them or create additional ones. By modifying determinants, you can override the index and key information in your data source, replacing it with information that is better aligned with your reporting and analysis needs. By adding determinants, you can represent groups of repeated data that are relevant for your application.

在查询主题中,通过呈现数据集或数据分组,Determinants反映数据粒度,并且用于确保重复的数据进行正确的聚合。在数据源中Determinants 与主键和索引密切相关,并基于唯一键和索引被导入。我们建议你经常复查被导入的determinants,如果必要,修改他们或建立额外的。通过修改determinants,你可以在FW的data source中重写index和key,替换它以更好的结合报表和分析需求。通过附加determinants,你可以呈现重复数据的分组在相关应用中。

 

An example of a unique determinant is Day in the Time example below. An example of a non-unique determinant is Month; the key in Month is repeated for the number of days in a particular month. When you define a non-unique determinant, you should specify group by. This indicates to Cognos 8 that when the keys or attributes associated with that determinant are repeated in the data, it should apply aggregate functions and grouping to avoid double-counting. It is not recommended that you specify determinants that have both uniquely identified and group by selected or have neither selected.

在以下Time示例中有一个唯一determinant应用例子。非唯一determinant是月;一个特定月份中,月份中的key对于日期数是重复的。当定义一个非唯一determinant,你应当指定一个分组。这将指示Cognos 8在这个determinant所关联的key或attributes是重复时,应用聚合函数和分组以避免重复计数。不建议指派determinants既是唯一标识又是选中分组,或者二者都不选。

 

When to Use Determinants

While determinants can be used to solve a variety of problems related to data granularity, you should always use them in the following primary cases:
Determinants可以被用于解决各种涉及数据粒度的问题,在以下主要情形中总是可以使用它们:

 

● A query subject that behaves as a dimension has multiple levels of granularity and will be joined on different sets of keys to fact data.

当一个query subject像是一个dimension有多重数据粒度levels,并且将依据fact数据key的不同设定作连接。

For example, Time has multiple levels, and it is joined to Inventory on the Month Key and to Sales on the Day Key. For more information, see "Multiple-fact, Multiple-grain Queries" (p. 327).

例如,时间有多个levels,它基于month key连接到inventory表,基于day key连接到sales表。

 

● There is a need to count or perform other aggregate functions on a key or attribute that is repeated.

当需要对一个有重复key或attribute进行计数或执行其它聚合函数时。

For example, Time has a Month Key and an attribute, Days in the month, that is repeated for each day. If you want to use Days in the month in a report, you do not want the sum of Days in the month for each day in the month. Instead, you want the unique value of Days in the month for the chosen Month Key. In SQL, that is XMIN(Days in the month for Month_Key) . There is also a Group by clause in the Cognos SQL.

示例,时间有一个月份key和一个attribute,日期带有月份,月份对于每一天是重复的。如果你想在一个报表中使用带有月份的日期,你别想要为每一天合计带有月份的日期,取代的所选月份key的日期唯一值。在SQL中,对应的是XMIN(Days in the month for Month Key). 在Cognos SQL中也有一个分组子句。

 

There are less common cases when you need to use determinants:

在一些个别情况下,你也需要使用determinants:

● You want to uniquely identify the row of data when retrieving text blob data from the data source.

当从数据源返回文本数据块时,你想要数据行唯一标识:

Querying blobs requires additional key or index type information. If this information is not present in the data source, you can add it using determinants. Override the determinants imported from the data source that conflict with relationships created for reporting.

You cannot use multiple-segment keys when the query subject accesses blob data. With summary queries, blob data must be retrieved separately from the summary portion of the query. To do this, you need a key that uniquely identifies the row and the key must not have multiple segments.

查询文本数据块需要附加key或index类型信息。如果这个信息没有在数据源中呈现,你要使用determinants添加它。覆盖从数据源导入的存在关系冲突的determinants,为报表创建新的determinants。

当query subject访问文本数据块时,你不能使用复合的keys。带有汇总查询时,文本数据块从查询的汇总部分那个别个别的返回数据。为此,你需要一个key来唯一标识数据行,并且key必须不是复合的。

 

● A join is specified that uses fewer keys than a unique determinant that is specified for a query subject.

当一个连接所指派使用的keys少于一个query subject的唯一determinant所派的keys时:

If your join is built on fewer columns than what is stored in Framework Manager within the determinants, there will be a conflict. Resolve this conflict by modifying the relationship to fully agree with the determinant or by modifying the determinant to support the relationship.

如果你的连接基于的keys少于它所存储在FW Manager中的determinants所使用的keys时,将会有一个冲突。通过修改relationship以满足determinants的keys指派要求,或通过修改determinants中的key以适应relationship的要求,来解决这个冲突问题。

 

● You want to override the determinants imported from the data source that conflict with relationships created for reporting.

当你想覆盖从数据源中导入的与releationship相冲突的determinants时:

For example, there are determinants on two query subjects for multiple columns but the relationship between the query subjects uses only a subset of these columns. Modify the determinant information of the query subject if it is not appropriate to use the additional columns in the relationship.

例如,基于二个query subject的determinants有多个字段,但二个query subject之间的relationship只使用这些字段中的一部分。如果在relationship中使用附加的字段不太适合,那么就修改query subject的determinants信息。

原创粉丝点击