Description
This function manipulates data in the VALUEMAP table in the Scribe Internal database to allow expression of many-to-one relationships.
The VALUEMAP table is used to resolve a given source to one of two different cross reference values, A or B. The VALUEMAPLOOKUPA function returns the value in the APP_A_VALUE field. Whereas, VALUEMAPLOOKUPB returns the value in the APP_B_VALUE field.
Syntax
VALUEMAPLOOKUPA ( map_label, APP_B_VALUE, default_value )
Parameter | Description |
---|---|
map_label | Search rows that contain this value in the Map_Label field. (This is the source value.) |
APP_B_VALUE | The value in this field will be returned. |
default_value | Default value to return if the lookup does not find the source value. |
Remarks
To express many-to-one relationships in VALUEMAP, set the PRECEDENCE field for each cross reference; the cross reference with the lowest precedence will be returned.
Examples
The following example looks at rows containing "Government" in the MAP_LABEL field and returns the value in the App_A Value field. If the source value cannot be found, the default value "Commercial" is returned.
VALUEMAPLOOKUPA( "Government", APP_B_VALUE, "Commercial" )
All rows with "Government" in the Map_Label field are searched. The corresponding APP_A_VALUE field value with the lowest precedence is returned.
See also