Qlik Sense Engine (qix)
The JSON-RPC API over WebSocket API that enables you to interact with the Qlik Associative Engine for Qlik Sense applications.
GenericMeasure
Applies a patch to the properties of an object. Allows an update to some of the properties. It should not be possible to patch "/qInfo/qId", and it will be forbidden in the near future.
Parameters
- qPatchesarray of objectsRequired
Array of patches.
qPatches properties
- qOpstring
Can be one of: "add""remove""replace"
- qPathstring
Path to the property to add, remove or replace.
- qValuestring
This parameter is not used in a remove operation. Corresponds to the value of the property to add or to the new value of the property to update. Examples: "false", "2", ""New title""
-
Response
objectErrors
arrayApplyPatches(qPatches)
const result = await genericMeasure.ApplyPatches([
[
{
"qOp": "add",
"qPath": "value",
"qValue": "value"
}
]
])
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "ApplyPatches",
"params": {
"qPatches": [
{
"qOp": "add",
"qPath": "value",
"qValue": "value"
}
]
}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
Adds the generic measure to the list of approved objects
Response
objectErrors
arrayApprove()
const result = await genericMeasure.Approve({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "Approve"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
Returns the type and identifier of the object.
Response
- qInfoobject
qInfo properties
- qIdstring
Identifier of the object. If the chosen identifier is already in use, the engine automatically sets another one. If an identifier is not set, the engine automatically sets one. This parameter is optional.
- qTypestring
Type of the object. This parameter is mandatory.
-
Errors
arrayGetInfo()
const result = await genericMeasure.GetInfo({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "GetInfo"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qInfo": {
"qId": "value",
"qType": "value"
}
}
}
Evaluates a measure and displays its properties, including the dynamic properties.
Response
- qLayoutobject
Is the layout for GenericMeasureProperties.
qLayout properties
- qInfoobject
qInfo properties
- qIdstring
Identifier of the object. If the chosen identifier is already in use, the engine automatically sets another one. If an identifier is not set, the engine automatically sets one. This parameter is optional.
- qTypestring
Type of the object. This parameter is mandatory.
-
- qMeasureobject
Information about the library measure. Is the layout for NxLibraryMeasureDef.
qMeasure properties
- qLabelstring
- qDefstring
- qGroupingstring
Can be one of: "N""H""C"
- qExpressionsarray of strings
- qActiveExpressioninteger
- qLabelExpressionstring
- qNumFormatobject
Sets the formatting of a field. The properties of qFieldAttributes and the formatting mechanism are described below.
Formatting mechanism
The formatting mechanism depends on the type set in qType, as shown below:
In case of inconsistencies between the type and the format pattern, the format pattern takes precedence over the type.Type is DATE, TIME, TIMESTAMP or INTERVAL
The following applies:
- If a format pattern is defined in qFmt , the formatting is as defined in qFmt .
- If qFmt is empty, the formatting is defined by the number interpretation variables included at the top of the script ( TimeFormat , DateFormat , TimeStampFormat ).
- The properties qDec , qThou , qnDec , qUseThou are not used.
Type is INTEGER
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the formatting mechanism uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , no formatting is applied. The properties qDec , qThou , qnDec , qUseThou and the number interpretation variables defined in the script are not used .
Type is REAL
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , and if the value is almost an integer value (for example, 14,000012), the value is formatted as an integer. The properties qDec , qThou , qnDec , qUseThou are not used.
- If no format pattern is defined in qFmt , and if qnDec is defined and not 0, the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
- If no format pattern is defined in qFmt , and if qnDec is 0, the number of decimals is 14 and the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is FIX
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , the properties qDec and qnDec are used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is MONEY
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of any script ( MoneyDecimalSep and MoneyThousandSep ).
- If no format pattern is defined in qFmt , the engine uses the number interpretation variables included at the top of the script ( MoneyDecimalSep and MoneyThousandSep ).
Type is ASCII
No formatting, qFmt is ignored.
qNumFormat properties
- qTypestring
Can be one of: "U""A""I""R""F""M""D""T""TS""IV"
- qnDecinteger
Number of decimals. Default is 10.
- qUseThouinteger
Defines whether or not a thousands separator must be used. Default is 0.
- qFmtstring
Defines the format pattern that applies to qText . Is used in connection to the type of the field (parameter qType ). For more information, see Formatting mechanism. Example: YYYY-MM-DD for a date.
- qDecstring
Defines the decimal separator. Example: .
- qThoustring
Defines the thousand separator (if any). Is used if qUseThou is set to 1. Example: ,
-
- qMetaobject
Layout for NxMetaDef.
qMeta properties
- qNamestring
Name. This property is optional.
-
-
Errors
arrayGetLayout()
const result = await genericMeasure.GetLayout({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "GetLayout"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qLayout": {
"qInfo": {
"qId": "value",
"qType": "value"
},
"qMeasure": {
"qLabel": "value",
"qDef": "value",
"qGrouping": "N",
"qExpressions": [
"value"
],
"qActiveExpression": 123,
"qLabelExpression": "value",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 123,
"qFmt": "value",
"qDec": "value",
"qThou": "value"
}
},
"qMeta": {
"qName": "value"
}
}
}
}
Lists the linked objects to a generic object, a dimension or a measure.
Response
- qItemsarray of objects
qItems properties
- qRootIdstring
Identifier of the root object. If the linked object is a child, the root identifier is the identifier of the parent. If the linked object is an app object, the root identifier is the same than the identifier of the linked object since the linked object is a root object.
- qInfoobject
qInfo properties
- qIdstring
Identifier of the object. If the chosen identifier is already in use, the engine automatically sets another one. If an identifier is not set, the engine automatically sets one. This parameter is optional.
- qTypestring
Type of the object. This parameter is mandatory.
-
-
Errors
arrayGetLinkedObjects()
const result = await genericMeasure.GetLinkedObjects({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "GetLinkedObjects"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qItems": [
{
"qRootId": "value",
"qInfo": {
"qId": "value",
"qType": "value"
}
}
]
}
}
Returns the definition of a measure.
Response
- qMeasureobject
qMeasure properties
- qLabelstring
Label of the measure.
- qDefstring
Definition of the measure.
- qGroupingstring
Can be one of: "N""H""C"
- qExpressionsarray of strings
Array of expressions.
- qActiveExpressioninteger
Index to the active expression in a measure.
- qLabelExpressionstring
Optional expression used for dynamic label.
- qNumFormatobject
Sets the formatting of a field. The properties of qFieldAttributes and the formatting mechanism are described below.
Formatting mechanism
The formatting mechanism depends on the type set in qType, as shown below:
In case of inconsistencies between the type and the format pattern, the format pattern takes precedence over the type.Type is DATE, TIME, TIMESTAMP or INTERVAL
The following applies:
- If a format pattern is defined in qFmt , the formatting is as defined in qFmt .
- If qFmt is empty, the formatting is defined by the number interpretation variables included at the top of the script ( TimeFormat , DateFormat , TimeStampFormat ).
- The properties qDec , qThou , qnDec , qUseThou are not used.
Type is INTEGER
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the formatting mechanism uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , no formatting is applied. The properties qDec , qThou , qnDec , qUseThou and the number interpretation variables defined in the script are not used .
Type is REAL
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , and if the value is almost an integer value (for example, 14,000012), the value is formatted as an integer. The properties qDec , qThou , qnDec , qUseThou are not used.
- If no format pattern is defined in qFmt , and if qnDec is defined and not 0, the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
- If no format pattern is defined in qFmt , and if qnDec is 0, the number of decimals is 14 and the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is FIX
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , the properties qDec and qnDec are used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is MONEY
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of any script ( MoneyDecimalSep and MoneyThousandSep ).
- If no format pattern is defined in qFmt , the engine uses the number interpretation variables included at the top of the script ( MoneyDecimalSep and MoneyThousandSep ).
Type is ASCII
No formatting, qFmt is ignored.
qNumFormat properties
- qTypestring
Can be one of: "U""A""I""R""F""M""D""T""TS""IV"
- qnDecinteger
Number of decimals. Default is 10.
- qUseThouinteger
Defines whether or not a thousands separator must be used. Default is 0.
- qFmtstring
Defines the format pattern that applies to qText . Is used in connection to the type of the field (parameter qType ). For more information, see Formatting mechanism. Example: YYYY-MM-DD for a date.
- qDecstring
Defines the decimal separator. Example: .
- qThoustring
Defines the thousand separator (if any). Is used if qUseThou is set to 1. Example: ,
-
Errors
arrayGetMeasure()
const result = await genericMeasure.GetMeasure({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "GetMeasure"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qMeasure": {
"qLabel": "value",
"qDef": "value",
"qGrouping": "N",
"qExpressions": [
"value"
],
"qActiveExpression": 123,
"qLabelExpression": "value",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 123,
"qFmt": "value",
"qDec": "value",
"qThou": "value"
}
}
}
}
Shows the properties of an object. Returns the identifier and the definition of the measure.
Response
- qPropobject
qProp properties
- qInfoobject
qInfo properties
- qIdstring
Identifier of the object. If the chosen identifier is already in use, the engine automatically sets another one. If an identifier is not set, the engine automatically sets one. This parameter is optional.
- qTypestring
Type of the object. This parameter is mandatory.
-
- qMeasureobject
qMeasure properties
- qLabelstring
Label of the measure.
- qDefstring
Definition of the measure.
- qGroupingstring
Can be one of: "N""H""C"
- qExpressionsarray of strings
Array of expressions.
- qActiveExpressioninteger
Index to the active expression in a measure.
- qLabelExpressionstring
Optional expression used for dynamic label.
- qNumFormatobject
Sets the formatting of a field. The properties of qFieldAttributes and the formatting mechanism are described below.
Formatting mechanism
The formatting mechanism depends on the type set in qType, as shown below:
In case of inconsistencies between the type and the format pattern, the format pattern takes precedence over the type.Type is DATE, TIME, TIMESTAMP or INTERVAL
The following applies:
- If a format pattern is defined in qFmt , the formatting is as defined in qFmt .
- If qFmt is empty, the formatting is defined by the number interpretation variables included at the top of the script ( TimeFormat , DateFormat , TimeStampFormat ).
- The properties qDec , qThou , qnDec , qUseThou are not used.
Type is INTEGER
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the formatting mechanism uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , no formatting is applied. The properties qDec , qThou , qnDec , qUseThou and the number interpretation variables defined in the script are not used .
Type is REAL
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , and if the value is almost an integer value (for example, 14,000012), the value is formatted as an integer. The properties qDec , qThou , qnDec , qUseThou are not used.
- If no format pattern is defined in qFmt , and if qnDec is defined and not 0, the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
- If no format pattern is defined in qFmt , and if qnDec is 0, the number of decimals is 14 and the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is FIX
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , the properties qDec and qnDec are used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is MONEY
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of any script ( MoneyDecimalSep and MoneyThousandSep ).
- If no format pattern is defined in qFmt , the engine uses the number interpretation variables included at the top of the script ( MoneyDecimalSep and MoneyThousandSep ).
Type is ASCII
No formatting, qFmt is ignored.
qNumFormat properties
- qTypestring
Can be one of: "U""A""I""R""F""M""D""T""TS""IV"
- qnDecinteger
Number of decimals. Default is 10.
- qUseThouinteger
Defines whether or not a thousands separator must be used. Default is 0.
- qFmtstring
Defines the format pattern that applies to qText . Is used in connection to the type of the field (parameter qType ). For more information, see Formatting mechanism. Example: YYYY-MM-DD for a date.
- qDecstring
Defines the decimal separator. Example: .
- qThoustring
Defines the thousand separator (if any). Is used if qUseThou is set to 1. Example: ,
-
- qMetaDefobject
Used to collect meta data.
Properties
Semantic type with an empty structure.
-
Errors
arrayGetProperties()
const result = await genericMeasure.GetProperties({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "GetProperties"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qProp": {
"qInfo": {
"qId": "value",
"qType": "value"
},
"qMeasure": {
"qLabel": "value",
"qDef": "value",
"qGrouping": "N",
"qExpressions": [
"value"
],
"qActiveExpression": 123,
"qLabelExpression": "value",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 123,
"qFmt": "value",
"qDec": "value",
"qThou": "value"
}
},
"qMetaDef": {}
}
}
}
Publishes a measure.
Response
objectErrors
arrayPublish()
const result = await genericMeasure.Publish({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "Publish"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
Sets some properties for a measure.
Parameters
- qPropobjectRequired
Information about the measure.
qProp properties
- qInfoobject
qInfo properties
- qIdstring
Identifier of the object. If the chosen identifier is already in use, the engine automatically sets another one. If an identifier is not set, the engine automatically sets one. This parameter is optional.
- qTypestring
Type of the object. This parameter is mandatory.
-
- qMeasureobject
qMeasure properties
- qLabelstring
Label of the measure.
- qDefstring
Definition of the measure.
- qGroupingstring
Can be one of: "N""H""C"
- qExpressionsarray of strings
Array of expressions.
- qActiveExpressioninteger
Index to the active expression in a measure.
- qLabelExpressionstring
Optional expression used for dynamic label.
- qNumFormatobject
Sets the formatting of a field. The properties of qFieldAttributes and the formatting mechanism are described below.
Formatting mechanism
The formatting mechanism depends on the type set in qType, as shown below:
In case of inconsistencies between the type and the format pattern, the format pattern takes precedence over the type.Type is DATE, TIME, TIMESTAMP or INTERVAL
The following applies:
- If a format pattern is defined in qFmt , the formatting is as defined in qFmt .
- If qFmt is empty, the formatting is defined by the number interpretation variables included at the top of the script ( TimeFormat , DateFormat , TimeStampFormat ).
- The properties qDec , qThou , qnDec , qUseThou are not used.
Type is INTEGER
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the formatting mechanism uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , no formatting is applied. The properties qDec , qThou , qnDec , qUseThou and the number interpretation variables defined in the script are not used .
Type is REAL
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , and if the value is almost an integer value (for example, 14,000012), the value is formatted as an integer. The properties qDec , qThou , qnDec , qUseThou are not used.
- If no format pattern is defined in qFmt , and if qnDec is defined and not 0, the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
- If no format pattern is defined in qFmt , and if qnDec is 0, the number of decimals is 14 and the property qDec is used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is FIX
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of the script ( DecimalSep and ThousandSep ).
- If no format pattern is defined in qFmt , the properties qDec and qnDec are used. If qDec is not defined, the variable DecimalSep defined at the top of the script is used.
Type is MONEY
The following applies:
- If a format pattern is defined in qFmt , the engine looks at the values set in qDec and qThou . If these properties are not defined, the engine uses the number interpretation variables included at the top of any script ( MoneyDecimalSep and MoneyThousandSep ).
- If no format pattern is defined in qFmt , the engine uses the number interpretation variables included at the top of the script ( MoneyDecimalSep and MoneyThousandSep ).
Type is ASCII
No formatting, qFmt is ignored.
qNumFormat properties
- qTypestring
Can be one of: "U""A""I""R""F""M""D""T""TS""IV"
- qnDecinteger
Number of decimals. Default is 10.
- qUseThouinteger
Defines whether or not a thousands separator must be used. Default is 0.
- qFmtstring
Defines the format pattern that applies to qText . Is used in connection to the type of the field (parameter qType ). For more information, see Formatting mechanism. Example: YYYY-MM-DD for a date.
- qDecstring
Defines the decimal separator. Example: .
- qThoustring
Defines the thousand separator (if any). Is used if qUseThou is set to 1. Example: ,
-
- qMetaDefobject
Used to collect meta data.
Properties
Semantic type with an empty structure.
-
Response
objectErrors
arraySetProperties(qProp)
const result = await genericMeasure.SetProperties([
{
"qInfo": {
"qId": "value",
"qType": "value"
},
"qMeasure": {
"qLabel": "value",
"qDef": "value",
"qGrouping": "N",
"qExpressions": [
"value"
],
"qActiveExpression": 123,
"qLabelExpression": "value",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 123,
"qFmt": "value",
"qDec": "value",
"qThou": "value"
}
},
"qMetaDef": {}
}
])
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "SetProperties",
"params": {
"qProp": {
"qInfo": {
"qId": "value",
"qType": "value"
},
"qMeasure": {
"qLabel": "value",
"qDef": "value",
"qGrouping": "N",
"qExpressions": [
"value"
],
"qActiveExpression": 123,
"qLabelExpression": "value",
"qNumFormat": {
"qType": "U",
"qnDec": 10,
"qUseThou": 123,
"qFmt": "value",
"qDec": "value",
"qThou": "value"
}
},
"qMetaDef": {}
}
}
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
Removes the generic measure from the list of approved objects
Response
objectErrors
arrayUnApprove()
const result = await genericMeasure.UnApprove({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "UnApprove"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}
Unpublishes a measure.
Response
objectErrors
arrayUnPublish()
const result = await genericMeasure.UnPublish({})
Request
{
"jsonrpc": "2.0",
"id": 1,
"handle": 3,
"method": "UnPublish"
}
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {}
}