todictword
Notes
The function accepts two syntax variants.
-
In the first case, the expression to search for is specified as the required argument $argument, and the dictionary columns to compare with this argument, are specified in the parameter Matchcolumn.
In this mode, you can search in several dictionary columns. In this case, they must be specified through a vertical bar: MatchColumn:=Derivative|Name.
For example, if one wants to output the Region field from a standard Geoadministrative dictionary by comparing the value of the $variable argument with the Derivative column of the same dictionary, one should write the following query:
todictword(GeoAdministrative, $variable, dictionary:=Default, MatchColumn:=Derivative, field:=Region)
-
The second option is a simplified, more compact syntax. In this case, one need to assign to the column the value of the $argument (e.g.: Derivative:=$x). In this mode, you can search only in one dictionary column.
Then the query from the first example will look like this:
todictword(GeoAdministrative, dictionary:=Default, Derivative:=$variable, field:=Region)
If dictionary name is not specified, the function uses all switched dictionaries of the same category. One can also specify several dictionaries using the vertical bar: dictionary:=X|Y.
Arguments
The function takes several required arguments.
Argument |
Comment |
dict_type |
Sets dictionary type. |
$argument |
A named variable to be converted to a dictionary field. |
MatchColumn |
The column against which the named variable $argument is compared to determine a match. |
field |
Resulting field. |
The function also takes the following optional named arguments:
Argument |
Comment |
dictionary |
Sets dictionary name. |
mode:=all/none/first |
In case of several matching entries in the dictionary, the parameter allows to choose between them. By default, mode:=first). |