✅ Note:
Given functions can be applied directly from Excel's Worksheet or through VBA code.
Function used to open a connection to a kdb+ process:
String qOpen ( alias, hostname, port, username, password, reEval )
where:
alias
[String
] - alias name that should be assigned to the connection currently being opened; this alias can later be used by other functions to reference specific connections (as multiple connections can be opened from the sameWorkbook
object)hostname
[String
] - name or IP address of the host to which connection should be openedport
[Int
] - port number of q process to connect tousername
[String
] - username used to connect to q process (optional)password
[String
] - password used to connect to q process (optional)reEval
[Cell
] - cell address used for re-evaluating connection to kdb+ server, any data type inside the cell can be used (optional)
Returns:
- alias bound with currently opened connection (when opened successfully)
- description of error (in case connection could not be established)
❗ Note:
Internally,
qXL
will store connection details as per given alias only. Therefore, one needs to be careful not to overwrite connection alias with different host and/or port number. For example if at first this call is executed:=qOpen("testConnection","localhost",5001)
followed by:
=qOpen("testConnection",172.16.254.1,17000)
then all functions using
testConnection
alias will refer to host172.16.254.1
on port17000
.
Function used to correctly close the connection bound with given alias:
String qClose ( alias )
where:
alias
[String
] - closes the connection bound with given alias
Returns:
- string
Closed
if connection is closed successfully - error description in case of failure
Function used to query data or call a kdb+ function using the connection bound with given alias:
Object qQuery ( alias, query, p1, p2, p3, p4, p5, p6, p7, p8 )
where:
alias
[String
] - connection alias to be usedquery
[String
] - query / function to be calledp1
top8
[String
] - optional parameters
Returns the query or function call result.
Function performs conversion of incoming value to specified q type and stores it in global container returning unique identifier for the data:
Object qAtom ( value, type )
where:
value
[Object
] - value to be convertedtype
[String
] - conversion string; see type mapping section for more details
Function returns the following array: (conversionKey,marker,error)
.
Function performs conversion of incoming value (range) to specified q list and stores it in global container returning unique identifier for the data:
Object qList ( value, type )
where:
value
[Object
] - value to be convertedtype
[String
] - conversion string; see type mapping section for more details
Function returns the following array: (conversionKey,marker,error)
.
Function creates q dictionary from provided data:
Object qDict ( keys, values, types )
where:
keys
[Object
] - dictionary keysvalues
[Object
] - values to be convertedtypes
[String
] - conversion strings; see type mapping section for more details
Function returns the following array: (conversionKey,marker,error)
.
Function creates q table from provided data:
Object qTable ( columnNames, values, types, keys )
where:
columnNames
[Object
] - name of the columnsvalues
[Object
] - data for the tabletypes
[String
] - type specification (conversion strings) of the columns; see type mapping section for more detailskeys
[Object
] - sublist of columns that should be considered as keys