Qix

The JSON-RPC API over websocket that enables you to interact with the Qlik Associative Engine.

Download specification

GenericVariable

GenericVariable ApplyPatches

(qPatches)

Applies a patch to the properties of a variable. 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.

Applying a patch takes less time than resetting all the properties.

Parameters

  • qPatchesarray of objects
    Required

    Array of patches.

    Show 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

object

Errors

array

ApplyPatches(qPatches)

const result = await genericVariable.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": {}
}

GenericVariable GetInfo

()

Returns the type and identifier of the object.

Response

  • qInfoobject
    Show 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

array

GetInfo()

const result = await genericVariable.GetInfo({})

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "GetInfo"
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    }
  }
}

GenericVariable GetLayout

()

Evaluates an object and displays its properties including the dynamic properties. If the member delta is set to true in the request object, only the delta is evaluated.

Response

  • qLayoutobject

    Is the layout for GenericVariableProperties.

    Show qLayout properties
    • qInfoobject
      Show 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.

    • qMetaobject

      Layout for NxMetaDef.

      Show qMeta properties
      • qNamestring

        Name. This property is optional.

    • qTextstring

      Some text.

    • qNumnumber

      A value.

    • qIsScriptCreatedboolean

      If set to true, it means that the variable was defined via script.

Errors

array

GetLayout()

const result = await genericVariable.GetLayout({})

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "GetLayout"
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "qLayout": {
      "qInfo": {
        "qId": "value",
        "qType": "value"
      },
      "qMeta": {
        "qName": "value"
      },
      "qText": "value",
      "qNum": 123,
      "qIsScriptCreated": true
    }
  }
}

GenericVariable GetProperties

()

Shows the properties of an object.

If the member **delta** is set to true in the request, only the delta is retrieved.
The following is always returned in the output:

Response

  • qPropobject
    Show qProp properties
    • qInfoobject
      Show 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.

    • qMetaDefobject

      Used to collect meta data.

      Properties

      Semantic type with an empty structure.

    • qNamestring

      Name of the variable. The name must be unique. This parameter is mandatory.

    • qCommentstring

      Comment related to the variable. This parameter is optional.

    • qNumberPresentationobject

      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.

      Show qNumberPresentation 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: ,

    • qIncludeInBookmarkboolean

      Set this property to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark. The value of a variable can affect the state of the selections. Script variables cannot be persisted in the bookmark. The default value is false.

    • qDefinitionstring

      Definition of the variable.

Errors

array

GetProperties()

const result = await genericVariable.GetProperties({})

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "GetProperties"
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "qProp": {
      "qInfo": {
        "qId": "value",
        "qType": "value"
      },
      "qMetaDef": {},
      "qName": "value",
      "qComment": "value",
      "qNumberPresentation": {
        "qType": "U",
        "qnDec": 10,
        "qUseThou": 123,
        "qFmt": "value",
        "qDec": "value",
        "qThou": "value"
      },
      "qIncludeInBookmark": true,
      "qDefinition": "value"
    }
  }
}

GenericVariable GetRawContent

()

Returns the raw value of a variable.

Response

  • qReturnstring

Errors

array

GetRawContent()

const result = await genericVariable.GetRawContent({})

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "GetRawContent"
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "qReturn": "value"
  }
}

GenericVariable SetDualValue

(qText, qNum)

Sets the value of a dual variable.

These changes are not persistent. They only last the duration of the engine session.

Parameters

  • qTextstring
    Required

    String representation of a dual value. Set this parameter to "", if the string representation is to be Null.

  • qNumnumber
    Required

    Numeric representation of a dual value.

Response

object

Errors

array

SetDualValue(qText, qNum)

const result = await genericVariable.SetDualValue([
  "value",
  123
])

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "SetDualValue",
  "params": {
    "qText": "value",
    "qNum": 123
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}

GenericVariable SetNumValue

(qVal)

Sets a numerical value to a variable.

These changes are not persistent. They only last the duration of the engine session.

Parameters

  • qValnumber
    Required

    Value of the variable.

Response

object

Errors

array

SetNumValue(qVal)

const result = await genericVariable.SetNumValue([
  123
])

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "SetNumValue",
  "params": {
    "qVal": 123
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}

GenericVariable SetProperties

(qProp)

Sets some properties for a variable.

The identifier of a variable cannot be modified.
You cannot update the properties of a script-defined variable using the _SetProperties method_.

Parameters

  • qPropobject
    Required

    Information about the variable.

    Show qProp properties
    • qInfoobject
      Show 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.

    • qMetaDefobject

      Used to collect meta data.

      Properties

      Semantic type with an empty structure.

    • qNamestring

      Name of the variable. The name must be unique. This parameter is mandatory.

    • qCommentstring

      Comment related to the variable. This parameter is optional.

    • qNumberPresentationobject

      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.

      Show qNumberPresentation 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: ,

    • qIncludeInBookmarkboolean

      Set this property to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark. The value of a variable can affect the state of the selections. Script variables cannot be persisted in the bookmark. The default value is false.

    • qDefinitionstring

      Definition of the variable.

Response

object

Errors

array

SetProperties(qProp)

const result = await genericVariable.SetProperties([
  {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMetaDef": {},
    "qName": "value",
    "qComment": "value",
    "qNumberPresentation": {
      "qType": "U",
      "qnDec": 10,
      "qUseThou": 123,
      "qFmt": "value",
      "qDec": "value",
      "qThou": "value"
    },
    "qIncludeInBookmark": true,
    "qDefinition": "value"
  }
])

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "SetProperties",
  "params": {
    "qProp": {
      "qInfo": {
        "qId": "value",
        "qType": "value"
      },
      "qMetaDef": {},
      "qName": "value",
      "qComment": "value",
      "qNumberPresentation": {
        "qType": "U",
        "qnDec": 10,
        "qUseThou": 123,
        "qFmt": "value",
        "qDec": "value",
        "qThou": "value"
      },
      "qIncludeInBookmark": true,
      "qDefinition": "value"
    }
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}

GenericVariable SetStringValue

(qVal)

Sets a string value to a variable.

These changes are not persistent. They only last the duration of the engine session.

Parameters

  • qValstring
    Required

    Value of the variable. The string can contain an expression.

Response

object

Errors

array

SetStringValue(qVal)

const result = await genericVariable.SetStringValue([
  "value"
])

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": 3,
  "method": "SetStringValue",
  "params": {
    "qVal": "value"
  }
}

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}