Class: AggregateObservation

data. AggregateObservation

An AggregateObservation is a wrapper over one or more Observation which it is aggregating.

An AggregateObservation belongs to an to a AggregatedDataSet and uses the aggregatedDataSet.getAggregationFunction() method when calculating the response to the AggregateObservation.getObsValue() method call

An AggregateObservation provides access to all the underlying Observations which make up this aggregate, from the getObservations() method


new AggregateObservation()

Methods


getDataSet()

Returns the AggregatedDataSet that this AggregateObservation belongs to.

Returns:
Type
data.DataSet

getDimensionValueByDimId(dimId)

Returns the reported Dimension Value for this Observations as a DataSetCode.

Returns null if no such observation value exists.

Parameters:
Name Type Description
dimId string

dimension id obtained from the data.DataSetComponent#getId

Returns:
Type
data.DataSetCode
Example
var dimCode = obs.getDimensionValueByDimId('FREQ');
var codeId = dimCode.getId();       //Returns a code value for FREQ e.g A
var codeName = dimCode.getName();   //Returns the code name e.g Annual

getDimensionValueByDimIdx(dimIdx)

Returns the reported Dimension Value as a DataSetCode for the given Dimension Index (zero indexed).

Parameters:
Name Type Description
dimIdx number

refers to the position of the data.DataSetComponent as defined by the data.DataSet#getDimensions method.

Returns:
Type
data.DataSetCode
Example
var dimCode = obs.getDimensionValueByDimIdx(0);
var dimId = dimCode.getId();       //Returns a code value for FREQ e.g A
var dimValue = dimCode.getName();  //Returns the code name e.g Annual

getObservations()

Returns all the underlying Observations that this aggregate is built from

Returns:
Type
Array.<data.Observation>

getObsValue()

Returns the observation value which is calculated by using the underlying Observation Values in conjunction with the AggregatedDataSet.getAggregationFunction().

Returns:
Type
number

getShortCode()

Returns a short code for this AggregateObservation.

The short code is a colon separated string of coded dimension values in the order that the dimensions are specified for example A:UK:FR:INFL:2008

Returns:
Type
string

getUid()

Returns:
Type
string