Defining a computed field
You can define a computed field.
About this task
When you define a field as a computed field, you cannot undo it.
System Admin Mode must be enabled to do this task.
Procedure
- Define basic information about the field. For more information, see Defining fields and adding them to field groups.
-
Select a Data Type. For more information, see
Table 1.
Table 1. Data types for computed fields Data Type Return Value When to Use Boolean TRUEorFALSE(case-insensitive)Takes a Boolean string, parses it, localizes it, and displays it. Date Date in the format: yyyy-MM-dd'T'hh:mm:ssTakes a date string, parses it, localizes it, and displays it. Decimal Any numbers Takes any number string and parses it, localizes it, and displays it. Integer Whole numbers Takes a whole number string and parses it, localizes it, and displays it. Simple String Any Can be used for any computed field. Takes the result of the computation engine and displays it. This will not be localized - it displays the exact output of the computation.
If the field is any other data type, use the Simple String data type.
-
Set Computed to True.
When you select Computed, the Required option disappears and several fields that support computed fields appear.
If you modeled the computed field in IBM® Cognos® Analytics - Reporting, the values displayed in the Report Specification XML window are not selectable (see Modeling a new computed field in Cognos). You can copy the report specification to the Clipboard (Tools | Copy Report to Clipboard), paste the information into a text document, and then copy the attribute values into OpenPages®. The value to be used in the application's Equation definition box can also be obtained from the Expression Definition pane of the calculation object.
-
Enter a value in the Equation box. The equation is
the Cognos SQL used to define the computed value
for the object field. It can be a reference to an existing query item in the published Cognos framework or an equation involving multiple
query items.
For example,
total ([DEFAULT].[SOXCONTROL].[CN_INHERENT_SEVERITY_REDU] for [DEFAULT].[SOXCONTROL].[RISK_ID]) / 100 -
Enter a value in the Primary Namespace box. The
Primary Namespace is the Cognos framework
namespace in which the computation is to be performed.
Note: All referenced query items in the values for Equation, Object ID Column, and Reporting Period ID Column must be in the same namespace.
For example,
DEFAULT. -
Enter a value in the Alternate Namespaces box if
necessary.
The Alternate Namespace is the Cognos framework namespaces to which the computation will be added during reporting framework generation.
Note: See Using computed fields with multiple namespaces for an explanation of why a computed field might need alternate namespaces. -
Enter a value in the Object Id Column box. The
Object ID Column is a reference to a Cognos
framework query item that contains the Resource ID of the computed field's object type. This value
must be the same for all computed fields in a given namespace for an object type.
For example:
[DEFAULT].[SOXRISK].[RI_RISK_ID] -
Enter a value in the Reporting Period Id Column
box. The Reporting Period ID Column is the Cognos
framework query item that contains the Reporting Period Id of the computed field's object type. This
value must be the same for all computed fields in a given namespace for an object type.
Important: The Resource ID and Reporting Period ID must match within the field group and object type. If these values do not match, the validation will fail.
For example,
[DEFAULT].[SOXRISK].[REPORTING_PERIOD_ID] - Enter the package label of the reporting package that the field is run against in Package Name. The value is case-sensitive. The package label for a framework model is defined in the Platform > Reporting Framework V6 > Models > [model name] > Package Label setting. If Package Name is empty, the package for the Platform Reporting framework model is used.
- Finish defining the field. For more information, see Defining fields and adding them to field groups.
Results
The equation is validated against the primary and alternate namespaces.