GOAL_GET ()

GOAL_GET ()

GOAL_GET (data_code, goal_type, [date = TODAY], [scope = ADMISSION])

Returns the last valid GOAL OBJECT in a date prior or equal to the specified date. If no scope is indicated, then ADMISSION is the default.

Input Parameters

ParameterTypeDefaultDescription
data_codeNumber, String, Array

goal_typeString
Type of GOAL OBJECT. Can be "MAX" or "MIN" (See GOAL OBJECT)
dateDate"TODAY"

Expected format "YYYY-MM-DD". if time part is present, it will be ignored

  • Special value "TODAY" is accepted
scopeString"ADMISSION"null or a valid SCOPE (See GOAL OBJECT)

Execution

Inmediately

Examples

GOAL_GET("WEIGHT", "MAX")
Returns the value of the last GOAL of type MAX (maximum) (no date was specified, so the function returns the last GOAL previous to TODAY)