以前使用Cognos计算初期库存和末期库存的时候都是自己创建计算项,今天看到一篇文章其实Cognos自己都有这样的功能,按照下面的步骤操作就可以实现了。
Fordimensionally modeled relation measures, you can define an aggregation rule called asemi-additive measure, which only relates to one specific measure and is notsummed across all dimensions. These rules are in addition to any regular aggregationrules applied to the measures.
For example,inventory stock is usually recorded with a monthly opening and closing stockbalance. To report an inventory for different time periods, you need to apply an aggregatethat takes the value for the appropriate time within the period. For an openingstock balance the inventory stock is the last balance of the previous month, and for aclosing stock balance the inventory stock is the last balance for the current month. Theinventory measure has a regular aggregate of the total and an aggregate for the timedimension with a last value.
To createthis semi-additive measure, perform the following steps:
1. In the Project Viewer panel, click on the Open Inventory measure in your measuredimension.
2. In the Properties pane, click on the <Click toedit> label nextto Aggregate Rules as seen in the preceding screenshot.
3. To add adimension for this measure, click on Add and select the Time dimensioncreated previously:
4. Tospecify the aggregate operation, click on the ellipsis (...) button in the Aggregation Rules box as seen in the following screenshot:
5. Thefollowing operations are supported:
Sum: This sums the values in the measure, and itis the default.
Minimum: This shows the minimum value in themeasure.
Maximum: This shows the maximum value in themeasure.
Average: This shows the average value in themeasure.
First: This shows the first value in the measure,and it is only relevant when we have a Time dimension in the model.
Last: This shows the last value in the measure,and it is only relevant when we have a time dimension in the model.
6. In this case, select Last and click on OK.