Overview
The function creates a two-column Excel array of names and values. Use it as the ConnectionName argument described in Multiple connections per formula, as the Dimensions or Settings argument in various Velixo NX functions, or any other use case that calls for a two-column array.
Unlike an Excel array constant in curly braces, VX.SETTINGS accepts cell references and formulas as names and values, so you can build the array dynamically.
Syntax
=VX.SETTINGS(
SettingNameOrValue,
SettingNameOrValue,
SettingNameOrValue,
SettingNameOrValue,
...
)
Arguments
|
Argument |
Required /
|
Description |
|---|---|---|
|
|
Required |
First key name (setting/dimension/parameter). |
|
|
Required |
A value corresponding to the key. |
|
… |
|
|
|
|
Optional |
Final key name(setting/dimension/parameter). |
|
|
Optional |
An additional value corresponding to the final key. If the N-th parameter name is provided, the N-th value is required. |
VX.SETTINGS treats a 0, typed in the formula or held in a cell, as the number 0. A 0 entered as text ("0") stays text. These count as empty values: a blank cell, a skipped argument (nothing between two commas), and text that is empty ("") or contains only spaces.
In cases where empty arguments are provided, the VX.SETTINGS function:
-
excludes a key-value pair from the spilled output when both the key and the value are empty,
-
does not exclude a pair when the key is present but the value is empty,
-
returns a
#VALUE!error when the key is empty, but the value is present in a pair, even when the value is0.
In cases where duplicate keys are provided, Velixo will deduplicate keys and join the values in a single range using the delimiter character.
Values are also joined when a single key is followed by a range of cells, such as a spill range (F2#): the key gets every value in the range, joined row by row, left to right. Empty values (see above) are skipped. If every cell in the range is empty, the key gets an empty value.
The delimiter character is set by the Element delimiter option in Options. The default setting, Comma and Semicolon, joins values with a semicolon (;).
If the values joined for a key are longer than 32,767 characters, the maximum for an Excel cell, VX.SETTINGS returns an error.
Examples
Literal values
=VX.SETTINGS("Connection","Connection1, Connection2","AggregationMode","sum","GlobalAggregation","TRUE")
Description: The result is an array that is ready to use as the multi-connection ConnectionName argument in numerous Velixo functions.
Dynamic filter
=VX.SETTINGS("Connection","like "&B1&"%","AggregationMode","stack-vertically","IncludeConnectionName",TRUE)
Description: Returns three setting name and value pairs. Used as the ConnectionName argument, it queries every connection whose name starts with the text in cell B1, stacks the results vertically, and adds a connection name column. For the like syntax, see Filtering using Velixo range expressions.
Values from a spill range
=VX.SETTINGS("DEPARTMENT",F2#)
Description: Cell F2 holds =VSTACK("ADM","PROD","SALES"), which spills into three cells. The result is one row: the key DEPARTMENT with the value ADM;PROD;SALES (with the default delimiter).