Class actuate.xtabanalyzer.Measure
Description
Defines a cross tab measure.
Constructor
Syntax
actuate.xtabanalyzer.Measure( )
Creates a cross tab measure object.
Function summary
Table 8‑13 lists actuate.xtabanalyzer.Measure functions.
Table 8‑13 actuate.xtabanalyzer.Measure functions 
Function
Description
Returns the aggregation function name
Returns the computed column data type
Returns the computed measure expression
Returns the measure index
Returns the measure name
Returns the new index
Sets the aggregation function name
Sets the computed column data type
Sets the computed measure expression
Sets the measure index
Sets the measure name
Sets the new index
getAggregationFunction
Syntax
string Measure.getAggregationFunction( )
Returns the aggregation function name.
Returns
String. An aggregation function name.
Example
This example changes the aggregation function:
function swapMeasureAggregation(measure){
if (measure.getAggregation( ) == "EQ"){
measure.setAggregation("NE");
}else{
measure.setAggregation("EQ");
}
}
getDataType
Syntax
string Measure.getDataType( )
Returns the computed column data type.
Returns
String. The data type.
Example
This example retrieves the computed column data type:
function getColumnDataType(measure){
if (measure){
return measure.getDataType( );
}
return null;
}
getExpression
Syntax
string Measure.getExpression( )
Returns the computed measure expression.
Returns
String. An expression.
Example
This example retrieves the computed measure expression:
function getMeasureExpression(measure){
if (measure){
return measure.getExpression( );
}
return null;
}
getIndex
Syntax
integer Measure.getIndex( )
Returns the measure index.
Returns
Integer. The measure index.
Example
This example retrieves the measure index:
function getMeasureIndex(measure){
if (measure){
return measure.getIndex( );
}
return null;
}
getMeasureName
Syntax
string Measure.getMeasureName( )
Returns the measure name.
Returns
String. The name of the measure.
Example
This example retrieves the measure name:
function getMeasureName(measure){
if (measure){
return measure.getMeasureName( );
}
return null;
}
getNewIndex
Syntax
integer Measure.getNewIndex( )
Retrieves the new index. The new index is set by setNewIndex and represents the index value the measure has after submit( ) finishes executing.
Returns
Integer. The new index.
Example
This example retrieves the new measure index:
function getNewMeasureIndex(measure){
if (measure){
return measure.getNewIndex( );
}
return null;
}
setAggregationFunction
Syntax
void Measure.setAggregationFunction(string aggregationFunction)
Sets the aggregation function name.
Parameter
aggregationFunction
String. The aggregation function name.
Example
This example changes the aggregation function:
function swapMeasureAggregation(measure){
if (measure.getAggregation( ) == "EQ"){
measure.setAggregation("NE");
}else{
measure.setAggregation("EQ");
}
}
setDataType
Syntax
void Measure.setDataType(string dataType)
Sets the computed column data type name.
Parameter
dataType
String. The data type.
setExpression
Syntax
void Measure.setExpression(string expression)
Sets the computed measure expression.
Parameter
expression
String. The computed measure expression.
Example
This example uses setExpression:
function addMeasure(viewer){
var crosstab = getCrosstab(viewer);
if(crosstab){
var measureName = "measureName";
var measureExpression =
"[revenue]/[revenue_SalesDate/year_Product/PRODUCTLINE]";
 
var measure = new actuate.xtabanalyzer.Measure( );
measure.setIndex(1);
measure.setMeasureName(measureName);
measure.setExpression(measureExpression);
 
crosstab.addMeasure(measure);
crosstab.submit( );
}
}
setIndex
Syntax
void Measure.setIndex(integer index)
Sets the index.
Parameter
index
Integer. The index of this measure.
Example
This example uses setIndex to add a new measure to a cross tab:
function setIndex(measure, index){
measure.setIndex(index);
}
setMeasureName
Syntax
void Measure.setMeasureName(string measureName)
Sets the measure name.
Parameter
measureName
String. The measureName.
Example
This example sets the measure name which is taken from a page element:
function renameMeasure(measure){
var measureName = document.getElementById("measureName").value;
measure.setMeasureName(measureName);
}
setNewIndex
Syntax
void Measure.setNewIndex(integer newIndex)
Sets a new measure index.
Parameter
newIndex
Integer. The new measure index.
Example
This example changes the index for the measure:
function changeIndex(measure,index){
if (measure){
measure.setNewIndex(index);
}
}