Please enable JavaScript to view this site.

QPR Knowledge Base 2019.1

Navigation: Developer's Guide > QPR API > The Object Model > QPR Metrics > SCModel Commands

GetValues

Scroll Prev Top Next More

Revision history:

Introduced in QPR 7.2.1

Last changed in QPR 2012

 

Returns element values in ElementValues parameter. If parameter ElementId is 0, then measure values for all measures are returned. If SeriesIdentifier is empty, then values for all series are returned. If PeriodId is 0, then values for periods are returned.

 

Synopsis:

 

SCModel.GetValues(ElementId, SeriesIdentifier, PeriodId, out ElementValues)

 

Parameters:

 

ElementId: Integer. Value 0 refers to all elements

SeriesIdentifier: String. Empty identifier refers to all series. Also constant value _DEFAULT can be used.

PeriodId: Integer. Value 0 refers to all periods. Also the following predefined constants can be used: LATEST = -1, CURRENTPERIOD = -2, PREVIOUS = -5, NEXT = -6. In the case the LATEST period is used, the latest existing value for each series is used, so there might be values from different periods for different series.

ElementValues: Pointer to variant array. The array has one row per value and a row contains the following columns:

Measure identifier, string

Scorecard identifier, string

Series identifier, string

Period name, string

Period start date, string (format depends on operating system's settings)

Period end date, string

Value, double

Range name, string

Range value, double

Indicator color, 4-byte integer value, which represents RGB color for the range

Trend value. integer (-2 = no trend, -1 = down, 0 = middle, 1 = up)

Formatted value, string. Value is formatted using the formatting attributes of the measurement unit.

Value unit, string

 

Note: If the value is retrieved for a single value slot (i.e. for a specific element, series, and period) and the retrieved value is null, then the RV_NO_DATA return value is returned and the contents of the ElementValues table are left undefined.

 

Required Rights:

 

At least view rights for the values of an element. At least model administrator rights for all the measures of the SCModel.

 

Return Values:

Below are listed the return values that this function can return:

 

RV_SUCCESS

RV_MODEL_NOT_OPEN

RV_NO_DATA

RV_NO_RIGHTS

RV_INVALID_PERIOD

RV_OBJECT_NOT_FOUND

RV_INVALID_ELEMENT_TYPE

RV_UNKNOWN_ERROR

 

Example Procedure:

 

iRet = oModel.GetValues(0, "", 0, Values) 'get all values from the model