MeasureMake

The MeasureMake verb creates a measure or updates an existing one.

The user interface equivalent, if the measure exists, is to modify the Measure property sheet. For a new measure, click the Insert option on the Edit menu when a measure is selected.

Every measure requires an AllocationAdd statement that contains the measure name and the option Type Default. Cognos® Transformer creates this statement automatically when a measure is added on the user interface or when you use the verb ModelEnsureCompleteness. Otherwise, you must create the statement. For more information, see AllocationAdd.

Measure names cannot contain an at sign (@).

The syntax is as follows:

MeasureMake objMeasure [meaopts] Associations assocopts

Argument

Description

MeasureMake objMeasure

Creates the measure objMeasure or modifies it if it exists. objMeasure can be the object name, object identifier, or both. Include the object name if the category does not exist.

meaopts

Optional parameters that describe the measure in greater detail. Some options are set by default if you do not set them. For the complete list of options, see meaopts. If the category exists, previously set options are retained unless you change them with this command.

Associations assocopts

Parameters that specify associations for the measure. For the complete list of options, see assocopts.

Example

The following statements were generated when a sample model created on the user interface was saved as an .mdl file.

This example creates or updates the StaffCount measure.

MeasureMake 863 "Staff Count" Missing N/A TimeStateRollup Average 
Storage Float64 OutPutScale 0 Decimals 0 ReverseSign False IsCurrency False
WeightId 899 DrillThrough False EndList Associations 1309 "Staff Count"
AssociationType Type_Query AssociationRole Role_Source 
AssociationReferenced "Staff Count"

This example creates or updates the calculated measure Profit Margin %.

MeasureMake "Profit Margin %" Calc ("Revenue@259" - "Product Cost@261") / 
"Revenue@259" Missing N/A Timing After_Rollup Storage Float64 Scale 0 
Decimals 1 Sign False Format "0%~1" MeasureInfo "Percent profit" 
DrillThrough False EndList

This example creates or updates a Revenue measure that allows drill-through to an IBM® Cognos Impromptu report (dt_cust.imr).

MeasureMake "Revenue" Association "Revenue" Storage Default Scale 0 
Decimals 0 Sign False Format "#,##0~0" 
MeasureInfo "Gross revenue from product sales."
DrillThrough True "c:\dt_cust.imr" "" EndList