Capability APIs

The Capability APIs are a collection of JavaScript APIs that allows you to easily embed Qlik Sense content into a web page, and interact with data. With just a few lines of code, it is possible to create a visualization that leverages the Qlik Sense visualization library. Consider using the qlik-embed toolkit with the classic/chart or analytics/chart UI for a more modern embedding experience.

Download specification

js/qlik module

External interface to qlik, for mashups and including qlik in foreign web pages.

Properties

  • navigation QNavigation
    Required
    Show navigation properties
    • ANALYSIS string
      Required

      Used for analysis mode.

    • EDIT string
      Required

      Used for edit mode.

    • getCurrentSheetId() function
      Required

      Get current sheet ID.

      Returns
      • The result of the navigation

        Show properties
        • success boolean
          Required

          true if the navigation was successful.

        • sheetId string

          The new sheet ID.

        • error string

          The error code if an error occurred, for example, NOSUCHSHEET or NOCURRENTSHEET.

        • errorMsg string

          The error message, for example, 'No current sheet'.

    • getMode() function
      Required

      Get current mode.

      Returns
      • string
        Required

        mode The current mode.

    • gotoSheet() function
      Required

      Navigates to a given sheet in the current app. Note that the method will return before the actual navigation takes place.

      Parameters
      • sheetId string
        Required

        The ID of the sheet to navigate to.

      Returns
    • gotoStory() function
      Required

      Navigates to a given story in the current app. Note that the method will return before the actual navigation takes place.

      Parameters
      • storyId string
        Required

        The ID of the story to navigate to.

      Returns
      • The result of the navigation operation.

        Show properties
        • success boolean
          Required

          true if the navigation was successful.

        • storyId string

          The new story ID.

        • error string

          The error code if an error occurred, for example, NOSUCHSTORY.

        • errorMsg string

          The error message, for example, 'No such story'.

    • isModeAllowed() function
      Required

      Checks if a given mode is allowed.

      Parameters
      • mode string
        Required

        The mode to check availability of. Can be either {@link QNavigaton#EDIT} or {@link QNavigaton#ANALYSIS}.

      Returns
      • boolean
        Required

        If the mode is allowed or not.

    • nextSheet() function
      Required

      Navigates to the next sheet in the current app. It will do nothing if you do not have sheets in the current context. Note that the method will return before the actual navigation takes place.

      Returns
    • prevSheet() function
      Required

      Navigates to the previous sheet in the current app. It will do nothing if you do not have sheets in the current context. Note that the method will return before the actual navigation takes place.

      Returns
    • setMode() function
      Required

      Set current mode.

      Parameters
      • mode string
        Required

        The mode to change to. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.

      Returns
      • The result of the mode change.

        Show properties
        • success boolean
          Required

          true if the operation was successful.

        • mode string

          The new mode. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.

        • error string

          The error code if an error occurred, for example, MODENOTALLOWED.

        • errorMsg string

          The error message, for example, 'Mode not allowed'.

  • Required
    Show theme properties
    • apply() function
      Required

      Apply a theme to all visualizations on the web page.

      Parameters
      • id string
        Required

        ID of theme to apply.

      Returns
      • Promise < boolean >
        Required

        Promise of a boolean to indicate success or not.

    • get() function
      Required

      Get theme as a QTheme object.

      Parameters
      • id string
        Required

        Theme id

      Returns
      • Promise < QTheme >
        Required

        A promise of a QTheme object.

js/qlik

var config = {
	 host: "myhost.com",
	 prefix: "/",
	 port: window.location.port,
	 isSecure: true
};
requirejs(["js/qlik"], function(qlik) {
	 // open the app
  var app = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d", config);
	 // insert Qlik objects into the page.
	 app.getObject(document.getElementById("LB01"), "uPyZavD");
}

js/qlik callRepository(path, method?, body?) function

Deprecated

Call Qlik repository.

Parameters

  • path string
    Required

    Path to the Qlik Sense repository. Refer to Qlik Sense repository documentation for the available paths.

  • method string

    HTTP method.

  • body string

    Body of the post.

Returns

  • Promise < object >
    Required

    A promise of a Qlik repository reply.

callRepository

qlik.callRepository("/qrs/extension/schema").then(function(reply) {
		console.log(JSON.stringify(reply));
	  });

js/qlik currApp(reference?) function

Get a reference to the current app. Use in an extension to get a reference to the app displayed.

Parameters

  • reference object

    Reference to extension object. Since Qlik Sense 1.1

Returns

  • Required

    An App JavaScript object with app methods.

    Show properties
    • addAlternateState() function
      Required

      Add an alternate state.

      Introduced in Qlik Sense 1.1.

      Parameters
      • qStateName string
        Required

        Alternate state name.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • back() function
      Required

      Back to prev selection.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • bookmark QBookmark
      Required
      Show bookmark properties
      • apply() function
        Required

        Apply bookmark.

        Parameters
        • id string
          Required

          Bookmark ID.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply. Since Qlik Sense 1.2.

      • create() function
        Required

        Create bookmark based on current selection.

        Parameters
        • title string
          Required

          Bookmark title.

        • description string
          Required

          Bookmark description.

        • sheetId string

          Bookmark sheet ID. Since Qlik Sense 2.2.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply. Since Qlik Sense 1.2.

      • remove() function
        Required

        Remove bookmark.

        Parameters
        • id string
          Required

          Bookmark ID.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply. Since Qlik Sense 1.2.

    • clearAll() function
      Required

      Clear all selections.

      Parameters
      • lockedAlso boolean

        Also clear locked fields. Since Qlik Sense 2.1

      • state string

        Alternate state name. Since Qlik Sense 2.1

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • close() function
      Required

      Close an app.

      Will also close the web socket and clear out client side data.

      Introduced in Qlik Sense 1.1

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • createCube() function
      Required

      Defines a Qlik Hypercube and registers a callback to receive the data.

      Parameters
      • qHyperCubeDef object
        Required

        Cube definition.

      • callback function

        Callback method. Parameter will contain a qHyperCube.

      Returns
      • Promise
        Required

        A promise of an object model.

    • createGenericObject() function
      Required

      Creates a Qlik Generic object and registers a callback to receive the data. The generic object can contain qHyperCubeDef, qListObjectDef and/or qStringExpression and qValueExpression. It will be a session object and disppears when the session is closed. The callback method will be called whenever the selection state changes in a way that affects the generic object. The parameter will be the evaluated version of the definition.

      Parameters
      • param object
        Required

        Generic object definition.

      • callback function

        Callback method.

      Returns
      • Promise
        Required

        A promise of an object model.

    • createList() function
      Required

      Defines a Qlik list of field values and registers a callback to receive the data.

      Parameters
      • qListObjectDef object
        Required

        List definition.

      • callback function

        Callback method. Parameter will contain a qListObject.

      Returns
      • Promise
        Required

        A promise of an object model.

    • createTable() function
      Required

      Defines a Qlik Hypercube and creates a table object wrapping the hypercube.

      Introduced in Qlik Sense 2.1.

      Parameters
      • dimensions Array< string  |  NxDimension >
        Required

        Dimensions to use. Should be a field name or a NxDimension structure for each entry.

      • measures Array< string  |  NxMeasure >
        Required

        Measures to use. Should be an expression or a NxMeasure structure for each entry.

      • options object

        Options to set.

      Returns
      • Required

        A table object of type QTable, which is initially empty but eventually will contain data. The table object will be updated when selection state changes.

    • destroySessionObject() function
      Required

      Destroys a Qlik Session object created with createGenericObject or any of createCube, createList, or getList calls.

      The object will be removed from engine, no more updates will be sent to the client and all methods on the object will be invalid.

      Introduced in Qlik Sense 1.1.

      Parameters
      • id string
        Required

        Session object ID.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • doReload() function
      Required

      Reload the app.

      Introduced in Qlik Sense 1.1

      Parameters
      • qMode number

        Error handling mode: 0 = default mode, 1 = attempt recovery on all errors, 2 = fail on all errors.

      • qPartial boolean

        Set to true for partial reload.

      • qDebug boolean

        Set to true if debug breakpoints are honored. Execution of the script will be in debug mode.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • doSave() function
      Required

      Save the app.

      Introduced in Qlik Sense 1.1.

      Parameters
      • qFileName string

        File name of the file to save.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • field() function
      Required

      Get a field reference with methods to manipulate field.

      Parameters
      • fld string
        Required

        Name of the field.

      • statename string

        Alternate state name.

      Returns
      • Required

        A QField object with methods and properties that can be used to manipulate the field.

        Show properties
        • clear() function
          Required

          Clears a field selection.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • clearOther() function
          Required

          Clears all field selections except this one.

          Parameters
          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • getData() function
          Required

          Gets field data. The values are available as QFieldValue in array field.rows and is updated when the selection state changes. Notification OnData will be triggered after each update.

          Introduced in Qlik Sense 2.1

          Parameters
          • options object

            Object containing options for the getData call.

            Show options properties
            • rows number

              Number of rows to fetch. Default 200.

            • frequencyMode string

              Sets the qFrequencyMode. V=Absolute, P=Percent, R=Relative, N=No frequency. Default V.

          Returns
        • getMoreData() function
          Required

          Get more data for your field. Notification OnData will be triggered when complete.

          Introduced in Qlik Sense 2.1

          Returns
        • lock() function
          Required

          Locks a field selection.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • Required

          OnData notification

          Show OnData properties
          • bind() function
            Required

            Observe a Notification by sending in an observer function.

            Parameters
            • observer function
              Required

              The observer function to handle the notification.

          • unbind() function
            Required

            Stop observing a notification.

            Parameters
            • observer function
              Required

              The observer function that now should ignore any future notifications.

        • qStateCounts object
          Required

          Object with number of values in different states. Only after getData() call.

          Introduced in Qlik Sense 2.1.

        • rowCount number
          Required

          Number of different values. Only after getData() call.

          Introduced in Qlik Sense 2.1.

        • rows Array< QFieldValue >
          Required

          Field values. You need to call getData() method to make this available. Since Qlik Sense 2.1.

        • select() function
          Required

          Select field values using indexes.

          Parameters
          • Array Array< any >
            Required

            of indexes to values to select.

          • toggle boolean

            If true, toggle selected state.

          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • selectAll() function
          Required

          Select all values in field.

          Parameters
          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • selectAlternative() function
          Required

          Select alternative values in field.

          Parameters
          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • selectExcluded() function
          Required

          Select excluded values in field.

          Parameters
          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • selectMatch() function
          Required

          Select matching field values.

          Parameters
          • match string
            Required

            Match string.

          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • selectPossible() function
          Required

          Select possible values in field.

          Parameters
          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • selectValues() function
          Required

          Select field values.

          Parameters
          • values Array< object >
            Required

            Array of qFieldValues to select. Since 1.1, a simplified syntax with strings OR numbers also works. Note that for a numeric field, you need to provide the numeric value.

          • toggle boolean

            If true, toggle selected state. If false replace the current selection.

          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • toggleSelect() function
          Required

          Toggle field selection.

          Parameters
          • match string
            Required

            Match string.

          • softlock boolean

            If true, locked selections can be overridden.

          Returns
          • Promise
            Required

            A promise of an engine response.

        • unlock() function
          Required

          Unlocks a field selection.

          Returns
          • Promise
            Required

            A promise of an engine response.

    • forward() function
      Required

      Forward

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • getAppLayout() function
      Required

      Get layout for this app and register a callback to receive the data.

      Introduced in Qlik Sense 1.1.

      Parameters
      • callback function

        Callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • getAppObjectList() function Deprecated
      Required

      Get a list of Qlik application objects and register a callback to receive the data.

      Parameters
      • type string

        Type of object. One of: sheet, MasterObject.

      • callback function

        Callback method.

    • getFullPropertyTree() function
      Required

      Get properties for a Qlik object including children properties.

      Parameters
      • id string
        Required

        Object ID.

      Returns
      • Promise
        Required

        A promise of an object model.

    • getList() function
      Required

      Get a list of internal Qlik objects and register a callback to receive the data.

      Parameters
      • type string
        Required

        Type of object. One of: FieldList, MeasureList, DimensionList, BookmarkList, SelectionObject, SnapshotList Since Qlik Sense 1.1, MediaList Since Qlik Sense 1.1, sheet Since Qlik Sense 1.1, MasterObject Since Qlik Sense 1.1, VariableList Since Qlik Sense 2.0, story Since Qlik Sense 2.1

      • callback function

        Registers a callback that is executed every time data is returned.

      Returns
      • Promise
        Required

        A promise of an object model.

    • getObject() function
      Required

      Inserts a Qlik object into an HTML element. The object will fill the HTML object, so you can size and position the element to determine how large the Qlik object will be.

      If you only supply one parameter, you will just get the model without displaying the object.

      Parameters
      • elem HTMLElement  |  string

        HTML element. Since version 1.1, it is also possible to define a string of the HTML element ID.

      • id string
        Required

        Object ID or 'CurrentSelections' if used for Selections bar. Since version November 2017 it is also possible to use 'AppNavigationBar' to on-demand app navigation bar.

      • options object

        Additional options.

        Show options properties
        • noInteraction boolean

          Set to true if you want to disable interaction, including selections, in the visualization. Since Qlik Sense 1.1

        • noSelections boolean

          Set to true if you want to disable selections in the visualization. Since Qlik Sense 3.0

        • variant string

          used only when getting 'CurrentSelections', for rendering the "dark" variant. Possible values: "dark".

        • sheetId string

          Sheet id where App Navigation bar exists. (only applies if id='AppNavigationBar') Since Qlik Sense November 2017

        • openAppCallback function

          Used if you want to handle what happens when user clicks the 'open generated app' button. Otherwise by default generated app is opened in new tab. Callback returns appId and targetSheetId. (only applies if id='AppNavigationBar') Since Qlik Sense November 2017

      Returns
      • Promise
        Required

        A promise of an object model.

    • getObjectProperties() function
      Required

      Get properties for a Qlik object.

      Parameters
      • id string
        Required

        Object ID.

      Returns
      • Promise
        Required

        A promise of an object model.

    • getScript() function
      Required

      Gets the data load script of this app.

      Introduced in Qlik Sense 4.0

      Returns
      • Promise
        Required

        A promise of a qScript object with the load script values.

    • getSnapshot() function
      Required

      Inserts a Qlik snapshot into an HTML element. The snapshot will fill the HTML object, so you can size and position the element to determine how large the Qlik object will be.

      If you only supply one parameter you will just get the model without displaying the object.

      Parameters
      • element HTMLElement  |  string

        HTML element or string with HTML element id.

      • id string
        Required

        Snapshot ID.

      Returns
      • Promise
        Required

        A promise of an object model.

    • lockAll() function
      Required

      Lock all selections.

      Parameters
      • state string

        Alternate state name. Since Qlik Sense 2.1.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • off() function
      Required

      Remove listener(s) for the app events.

      Introduced in Qlik Sense February 2018.

      Parameters
      • eventName string

        Name of the event. Can be: error, warning, closed. If no eventName is provided, removes all listeners.

    • on() function
      Required

      Add listener(s) to the app events. Possible events are error, warning and closed. Multiple listeners can be added to an event.

      Introduced in Qlik Sense February 2018.

      Parameters
      • eventName string
        Required

        Name of the event. Can be: error, warning, closed.

      • callback function
        Required

        Callback method.

    • removeAlternateState() function
      Required

      Remove an alternate state.

      Introduced in Qlik Sense 1.1.

      Parameters
      • qStateName string
        Required

        Alternate state name

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • searchAssociations() function Deprecated
      Required

      Searches for one or more terms in the values of an app.

      Introduce in Qlik Sense 1.1.

      Parameters
      • qTerms Array< string >
        Required

        Terms to search for.

      • qPage object
        Required
        Show qPage properties
        • qOffset number
          Required

          Position from the top, starting from 0.

        • qCount number
          Required

          Number of search results to return.

        • qMaxNbrFieldMatches number
          Required

          Maximum number of matching values to return per search result.

      • qOptions object

        Search options.

        Show qOptions properties
        • qSearchFields Array< string >

          List of search fields.

        • qContext string

          Search context. Can be one of: Cleared, LockedFieldsOnly, CurrentSelections.

      • callback function

        Callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • searchResults() function
      Required

      Searches for one or more terms in the values of an app.

      Introduced in Qlik Sense 2.2.

      Parameters
      • qTerms Array< string >
        Required

        Terms to search for.

      • qPage object
        Required
        Show qPage properties
        • qOffset number
          Required

          Position from the top, starting from 0.

        • qCount number
          Required

          Number of search results to return.

        • qGroupOptions Array< SearchGroupOptions >

          Options of the search groups. If this property is not set, all values are returned.

        • qGroupItemOptions Array< SearchGroupItemOptions >

          Options of the search group items. If this property is not set, all values are returned.

      • qOptions object

        Search options.

        Show qOptions properties
        • qSearchFields Array< string >

          List of search fields.

        • qContext string

          Search context. Can be one of: Cleared, LockedFieldsOnly, CurrentSelections.

      • callback function

        Callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • searchSuggest() function
      Required

      Returns search suggestions.

      Introduced in Qlik Sense 1.1.

      Parameters
      • qTerms Array< string >
        Required

        Terms to search for.

      • qOptions object

        Search options.

        Show qOptions properties
        • qSearchFields Array< string >

          List of search fields.

      • callback function

        Callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • selectAssociations() function
      Required

      Make a selection based on searchAssociaton results.

      Introduced in Qlik Sense 1.1.

      Parameters
      • qMatchIx number

        Index to search result.

      • qTerms Array< string >

        Values to select.

      • qOptions object

        Parameter sent to the Qlik engine containing information about the search fields and the search context.

        Show qOptions properties
        • qSearchFields Array< string >

          List of the search fields. If empty, the search is performed in all fields of the app.

        • qContext string

          Search context. Can be one of: Cleared, LockedFieldsOnly, CurrentSelections.

      • qSoftLock boolean

        Use the qOptions.qContext parameter instead.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • selectionState() function
      Required

      Creates a SelectionState object that encapsulates the selection state.

      Introduced in Qlik Sense 2.2.

      Parameters
      • state string

        Sets the state.

      Returns
      • A selection state object for the selection state of type QSelectionState.

        Show properties
        • stateName string
          Required

          State name, '$' for default state.

        • selections Array< QFieldSelections >
          Required

          Selections

        • backCount number
          Required

          Number of back steps available.

        • forwardCount number
          Required

          Number of forward steps available.

        • Required

          OnData notification.

        • clearAll() function
          Required

          Clear all selections in this state.

          Parameters
          • lockedAlso boolean

            Clear locked fields also.

          Returns
          • Promise
            Required

            A promise of a Qlik engine reply.

        • lockAll() function
          Required

          Lock all selections in this state.

          Returns
          • Promise
            Required

            A promise of a Qlik engine reply.

        • unlockAll() function
          Required

          Unlock all selections in this state.

          Returns
          • Promise
            Required

            A promise of a Qlik engine reply

    • setScript() function
      Required

      Sets the data load script of this app. Also validates the script syntax and returns the syntax errors if errors exist.

      Introduced in Qlik Sense 4.0.

      Parameters
      • script string
        Required

        The script content.

      Returns
      • Promise
        Required

        A promise of an empty object or a list of syntax errors depending on the validation result.

    • Required
      Show theme properties
      • get() function
        Required

        Get theme as a QTheme object.

        Parameters
        • id string

          Theme ID. If no ID is specified, the theme saved for the app is returned.

        Returns
        • Promise < QTheme >
          Required

          A promise of a QTheme object.

      • getApplied() function
        Required

        Get currently applied theme as a QTheme object.

        Returns
        • Promise < QTheme >
          Required

          A promise of a QTheme object.

      • save() function
        Required

        Save a theme ID of an app.

        Introduced in Qlik Sense February 2018.

        Parameters
        • id string
          Required

          Theme ID.

    • unlockAll() function
      Required

      Unlock all selections.

      Parameters
      • state string

        Alternate state name. Since Qlik Sense 2.1.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • variable QVariable
      Required
      Show variable properties
      • create() function
        Required

        Create variable.

        Returns
        • Promise
          Required

          Promise of a Variable model.

      • createSessionVariable() function
        Required

        Create session variable, which is a temporary variable that is not persisted and needs to be recreated for each new session.

        Introduced in Qlik Sense 2.1.

        Parameters
        • qProp object
          Required

          Variable properties.

          Show qProp properties
          • qInfo object
            Required
            Show qInfo properties
            • qId string

              Variable ID.

          • qName string
            Required

            Variable name.

          • qComment string

            Comment regarding the variable.

          • qDefinition string

            Variable definition.

          • qNumberPresentation object

            Defines the format of the value.

          • qIncludeInBookmark boolean

            Include in bookmark flag.

        Returns
        • Promise
          Required

          Promise of a Variable model.

      • get() function
        Required

        Get a variable by ID.

        Introduced in Qlik Sense 2.1.

        Parameters
        • qId string
          Required

          Variable ID.

        Returns
        • Promise
          Required

          Promise of a Variable model.

      • getByName() function
        Required

        Get a variable by name.

        Introduced in Qlik Sense 2.1.

        Parameters
        • qName string
          Required

          Variable name.

        Returns
        • Promise
          Required

          A promise of a Variable model.

      • getContent() function
        Required

        Get variable content.

        Parameters
        • name string
          Required

          Variable name.

        • Required

          Callback to receive the content.

          Show callback properties
          • getContentCallback() function
            Required
            Parameters
            • data object
              Required

              Content of the variable.

              Show data properties
              • qContent object
                Required

                Value of the variable.

                Show qContent properties
                • qString string
                  Required

                  Textual value of the variable.

                • qIsNum number
                  Required

                  Numeric value of the variable, if the value can be converted into a number.

            • qapp object
              Required

              The qlik.app object wrapping the app.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply.

      • setContent() function Deprecated
        Required

        Set variable content.

        Parameters
        • name string
          Required

          Variable name.

        • content string
          Required

          Variable content.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply.

      • setNumValue() function
        Required

        Set variable numeric value.

        Introduced in Qlik Sense 2.1.

        Parameters
        • qName string
          Required

          Variable name.

        • qVal number
          Required

          Variable value.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply.

      • setStringValue() function
        Required

        Set variable string value.

        Introduced in Qlik Sense 2.1.

        Parameters
        • qName string
          Required

          Variable name.

        • qVal string
          Required

          Variable value.

        Returns
        • Promise
          Required

          A promise of a Qlik engine reply.

    • visualization QAppVisualization
      Required
      Show visualization properties
      • create() function
        Required

        Create a new visualization. The visualization will be based on a session object and not persisted in the app.

        Parameters
        • type string
          Required

          Visualization type. Built-in visualization like barchart, piechart, linechart, combochart or an extension.

        • cols Array< string  |  NxDimension  |  NxMeasure >

          Column definitions, dimensions and measures. Each entry can be a string, an NxDimension or NxMeasure structure. If the NxDimension or NxMeasure refers to a library dimension or measure, you also might need to add qType measure or dimension.

        • options object

          Options to set. Refer to documentation for the visualization used for additional options.

          Show options properties
          • title string  |  Expression

            Visualization title.

          • showTitles boolean

            Show title for visualization. Default true.

          • subtitle string  |  Expression

            Visualization subtitle.

          • footnote string  |  Expression

            Visualization footnote.

        Returns
      • get() function
        Required

        Get an existing visualization.

        Introduced in Qlik Sense 2.2.

        Parameters
        • id string
          Required

          ID for an existing visualization.

        Returns

currApp

var app = qlik.currApp(this);
   app.clearAll();

js/qlik getAppList(callback, config?) function

Get a list of Qlik apps and register a callback to receive the data. The reply will contain all apps the user has access to.

Parameters

  • callback function
    Required

    Callback method.

  • config object

    Additional configuration parameters.

    Show config properties
    • host string

      Qlik host

    • port string  |  number

      Port number as a string or a number.

    • prefix string

      Qlik virtual proxy, '/' if no proxy

    • isSecure boolean

      Use SSL

    • identity string

      Unique identity for the session. If omitted, the session will be shared.

getAppList

var config = {
		host: "myhost.com",
		prefix: "/",
		port: window.location.port,
		isSecure: true
	};
 qlik.getAppList(function(list){
		var str = "";
		list.forEach(function(value) {
			str +=  value.qDocName + "("+ value.qDocId +") ";
		});
		console.log(str);
	}, config);

js/qlik getExtensionList(callback?) function

Deprecated

Get the list of extensions installed in the system. The reply will contain all extensions such as visualizations, mashups, and so on.

Parameters

  • callback function

    Callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getExtensionList

qlik.getExtensionList(function(list){
		var str = "";
		list.forEach(function(value) {
			str +=  value.id + "(" + value.data.type + ") ";
		});
		console.log(str);
	});

js/qlik getGlobal(config?) function

Open a connection with a Web Socket to engine for global methods.

Parameters

  • config object

    Additional configuration parameters.

    Show config properties
    • host string

      Qlik host

    • port string  |  number

      Port number as a string or a number.

    • prefix string

      Qlik virtual proxy, '/' if no proxy

    • isSecure boolean

      Use SSL

    • identity string

      Unique identity for the session. If omitted, the session will be shared.

Returns

  • Required

    A global JavaScript object with global methods.

    Show properties
    • cancelReload() function
      Required

      Cancel reload.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • getAppList() function
      Required

      Get app list.

      Parameters
      • callback function
        Required

        callback method.

    • getAuthenticatedUser() function
      Required

      Retrieves information about the authenticated user. Note: This method is only applicable to Qlik Sense Enterprise on Windows. For Qlik Sense Enterprise SaaS, use {@link https://qlik.dev/apis/rest/users#%23%2Fentries%2Fusers%2Fme-get|User API}

      Parameters
      • callback function

        callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • getProductVersion() function Deprecated
      Required

      Get Product Version.

      Introduced in Qlik Sense 1.2.

      Parameters
      • callback function

        callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • getProgress() function
      Required

      Get Progress.

      Introduced in Qlik Sense 2.1.

      Parameters
      • qRequestId number
        Required

        RequestId from doReload call or 0. Complete information is returned if the identifier of the request is specified. If qRequestId = 0, less information is returned.

      • callback function

        callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • getQTProduct() function
      Required

      Get QT Product.

      Parameters
      • callback function

        callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • isPersonalMode() function
      Required

      Get isPersonalMode.

      Parameters
      • callback function

        callback method.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • off() function
      Required

      Remove listener(s) for the global events.

      Introduced in Qlik Sense February 2018.

      Parameters
      • eventName string

        Name of the event. Can be: error, warning, closed. Removes all listeners if no eventName is provided.

    • on() function
      Required

      Adds listeners to the global events. Possible events are error, warning, and closed. Multiple listeners can be added to an event.

      Introduced in Qlik Sense February 2018

      Parameters
      • eventName string
        Required

        Name of the event. Can be: error, warning, closed.

      • callback function
        Required

        Callback method.

getGlobal

var config = {
		host: "myhost.com",
		prefix: "/",
		port: window.location.port,
		isSecure: true
	  };
   var global = qlik.getGlobal(config);
   global.getAuthenticatedUser(function(reply){
		console.log("User:"+reply.qReturn);
	  });

js/qlik getThemeList() function

Get a list of themes from the system. The list will contain both default and custom themes.

Returns

  • Promise
    Required

    A promise of a list of themes including the ID and the metadata name.

getThemeList

qlik.getThemeList().then(function(list){
		var str = "";
		list.forEach(function(value) {
			str += value.name + '(' + value.id + ")\n";
		});
		console.log(str);
	});

js/qlik off(eventName?) function

Remove listener(s) for the qlik instance events.

Parameters

  • eventName string

    Name of the event. If no eventName is provided, removes all listeners.

off

qlik.on("error", err=>{
  console.error(err);
});
qlik.off("error");

js/qlik on(eventName, callback) function

Add listener(s) to the qlik instance events. Possible events are error, warning, and closed. Multiple listeners can be added to an event.

Parameters

  • eventName string
    Required

    Name of the event. Can be: error, warning, closed. Note: this event handler will be overridden by app event handlers or global event handlers if set.

  • callback function
    Required

    Callback method.

on

qlik.on("error", err=>{
  console.error(err);
});
qlik.on("warning", warn=>{
  console.warn(warn);
});

js/qlik openApp(appId, config?) function

Opens the app. You can open multiple apps. Most other methods are defined on the app. Introduced in Qlik Sense 1.0.

Parameters

  • appId string
    Required

    The app ID.

  • config object

    Additional configuration parameters.

    Show config properties
    • host string

      Qlik host

    • port string  |  number

      Port number as a string or a number.

    • prefix string

      Qlik virtual proxy, '/' if no proxy

    • isSecure boolean

      Use SSL

    • openWithoutData boolean

      Open app without loading data. Since Qlik Sense 1.1

    • identity string

      Unique identity for the session. If omitted, the session will be shared.

Returns

  • Required

    An App JavaScript object with app methods.

openApp

var app = qlik.openApp("2abac31e-3b46-4b78-8bxf-c5cea1d2514d");
     var config = {
		  host: "myhost.com",
		  prefix: "/",
		  port: window.location.port,
		  isSecure: true
	    };
     var app2 = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d", config);

js/qlik Promise(executor) function

Promise utility that can be used for asynchronous operations. Very useful for the paint method to indicate that the rendering is complete. Full documentation available on: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise.

Parameters

  • executor function
    Required

    The executing function with two parameters: resolve and reject.

Promise

var Promise = qlik.Promise;
qlik.registerExtension("dumpchart",
       {
     	paint:function($element,layout) {
       		return new Promise(function(resolve, reject) {
       	    	setTimeout(function() {
       	        	$element.html(JSON.stringify(layout));
       	        	resolve(); // Extension painted successfully
       	    	}, 1000);
       		});
       	}
   });

js/qlik registerExtension(id, impl, metadata?) function

Register an extension for use in this mashup. The extension will not be installed on Qlik Sense server, but only available in the session where it is created.

Parameters

  • id string
    Required

    Set the ID of the visualization extension.

  • impl object
    Required

    Set the extension implementation.

  • metadata object

    Extension metadata, same format as QEXT file.

registerExtension

qlik.registerExtension("dumpchart",

   {
       paint:function($element,layout){
           $element.html(JSON.stringify(layout));
       }
   });
requirejs([path +"/wordcloud/wordcloud.js"],function(wordcloud)
{
   qlik.registerExtension( "wordcloud", wordcloud );
});

js/qlik resize(ID?) function

Sends a resize event to all Qlik objects.

Parameters

  • ID string

    Object ID. Optional: if no ID, resize event will be sent to all objects.

resize

//create the tabs and make qlik objects resize
 //when a new tab is selected
 $("#tabs").tabs().bind("tabsselect", function(event, ui) {
		qlik.resize();
	});

js/qlik sessionApp(config?) function

Creates a session/cached QApp object.

Parameters

  • config object

    Additional configuration parameters.

    Show config properties
    • host string

      Qlik host

    • port string  |  number

      Port number as a string or a number.

    • prefix string

      Qlik virtual proxy, '/' if no proxy.

    • isSecure boolean

      Use SSL.

    • identity string

      Unique identity for the session. If omitted, the session will be shared.

Returns

  • Required

    An app JavaScript object with app methods.

sessionApp

Basic usage

var sessionApp = qlik.sessionApp();

Basic usage with config

var config = {
  host: "myhost.com",
  prefix: "/",
  port: window.location.port,
  isSecure: true
};
var sessionApp =  qlik.sessionApp(config);

js/qlik sessionAppFromApp(appId, config?) function

Creates a session/cached QApp object from an existing app.

Parameters

  • appId string
    Required

    App ID of the app to base the session app upon.

  • config object

    Additional configuration parameters.

    Show config properties
    • host string

      Qlik host

    • port string  |  number

      Port number as a string or a number.

    • prefix string

      Qlik virtual proxy, '/' if no proxy.

    • isSecure boolean

      Use SSL.

    • identity string

      Unique identity for the session. If omitted, the session will be shared.

Returns

  • Required

    An app JavaScript object with app methods.

sessionAppFromApp

Basic usage

var sessionApp = qlik.sessionAppFromApp("2abac31e-3b46-4b78-8bxf-c5cea1d2514d");

Basic usage with config

var config = {
  host: "myhost.com",
  prefix: "/",
  port: window.location.port,
  isSecure: true
};
var sessionApp = qlik.sessionAppFromApp("2abac31e-3b46-4b78-8bxf-c5cea1d2514d", config);

Multiple apps

var sessionApp = qlik.sessionAppFromApp("2abac31e-3b46-4b78-8bxf-c5cea1d2514d");
var sessionApp2 = qlik.sessionAppFromApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d");

js/qlik setDeviceType(deviceType) function

Sets device type, which modifies the UI accordingly. The device type is automatically detected if it is not manually set.

Parameters

  • deviceType string
    Required

    Type of device. One of: auto, touch, desktop.

setDeviceType

qlik.setDeviceType('desktop');

js/qlik setLanguage(lang) function

Set language.

Parameters

  • lang string
    Required

    Language code

setLanguage

qlik.setLanguage("es");

js/qlik setOnError(onError, onWarning?) function

Deprecated

Parameters

  • onError function
    Required

    Error handling function.

  • onWarning function

    Warning handling function. Since Qlik Sense 2.1.

setOnError

qlik.setOnError(function(error) {
  //contains code, message
	 console.log(error.message);
},
function(warning){
	 windows.console.log(warning);
});

js/qlik table(ext, path?) function

Create a QTable object that wraps data in your extension and provides an object-oriented interface.

Parameters

  • ext object
    Required

    Extension or angular scope for the extension.

  • path string

    Path to the hypercube.

Returns

  • Required

    table - A QTable object that holds data and options for the table.

    Show properties
    • rows Array< QRow >
      Required

      Data rows.

    • headers Array< QHeader >
      Required

      Header information.

    • totals Array< QMeasureCell >
      Required

      Total information for measures.

    • rowCount number
      Required

      Total number of rows for the qHyperCube, including rows not fetched from server.

    • colCount number
      Required

      Total number of columns for the qHyperCube.

    • exportData() function
      Required

      Export data of the underlying hyperCube in OOXML or CSV format.

      Note: The entire hyperCube will be exported, not just the current data-page. On Cloud this functionality will go through the Reports API, which limits the available options

      Parameters
      • options object
        Show options properties
        • format string

          Data format. Can be one of: OOXML (open XML, default), CSV_C (comma separated CSV), CSV_T (tab separated CSV)

        • filename string

          This parameter is optional and only used in desktop. Sets the name of the exported file when downloaded. Example: filename(guid).xlsx.

        • state string

          Can be: A: all values, P: possible values (default)

        • download boolean

          Automatically start download of file (with window.open), defaults to false.

      • callback function

        Callback function returning the link to the exported file.

    • getColByName() function
      Required

      Get column number for a given field name.

      Parameters
      • fld string
        Required

        Field name.

      Returns
      • number
        Required

        Column number, starting with zero. Undefined if no column with that name.

    • getMoreData() function
      Required

      Get more data for your qHyperCube.

table

$scope.table = qlik.table(this);

<tr ng-repeat="row in table.rows">
   <td ng-repeat="cell in row.cells"> {{cell.qText}} </td>
</tr>

new Notification() class

Notification bind(observer) function

Observe a Notification by sending in an observer function.

Parameters

  • observer function
    Required

    The observer function to handle the notification.

Notification unbind(observer) function

Stop observing a notification.

Parameters

  • observer function
    Required

    The observer function that now should ignore any future notifications.

ObjectMetricSize object

Describes the size, in millimeters (mm), of a 2D object.

Properties

  • height number
    Required

    Object height in millimeters (mm).

  • width number
    Required

    Object width in millimeters (mm).

ObjectPixelSize object

Describes the size, in pixels, of a 2D object.

Properties

  • height number
    Required

    Object height in pixels.

  • width number
    Required

    Object width in pixels.

new QApp() class

Properties

  • bookmark QBookmark
    Required
    Show bookmark properties
    • apply() function
      Required

      Apply bookmark.

      Parameters
      • id string
        Required

        Bookmark ID.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply. Since Qlik Sense 1.2.

    • create() function
      Required

      Create bookmark based on current selection.

      Parameters
      • title string
        Required

        Bookmark title.

      • description string
        Required

        Bookmark description.

      • sheetId string

        Bookmark sheet ID. Since Qlik Sense 2.2.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply. Since Qlik Sense 1.2.

    • remove() function
      Required

      Remove bookmark.

      Parameters
      • id string
        Required

        Bookmark ID.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply. Since Qlik Sense 1.2.

  • Required
    Show theme properties
    • get() function
      Required

      Get theme as a QTheme object.

      Parameters
      • id string

        Theme ID. If no ID is specified, the theme saved for the app is returned.

      Returns
      • Promise < QTheme >
        Required

        A promise of a QTheme object.

    • getApplied() function
      Required

      Get currently applied theme as a QTheme object.

      Returns
      • Promise < QTheme >
        Required

        A promise of a QTheme object.

    • save() function
      Required

      Save a theme ID of an app.

      Introduced in Qlik Sense February 2018.

      Parameters
      • id string
        Required

        Theme ID.

  • variable QVariable
    Required
    Show variable properties
    • create() function
      Required

      Create variable.

      Returns
      • Promise
        Required

        Promise of a Variable model.

    • createSessionVariable() function
      Required

      Create session variable, which is a temporary variable that is not persisted and needs to be recreated for each new session.

      Introduced in Qlik Sense 2.1.

      Parameters
      • qProp object
        Required

        Variable properties.

        Show qProp properties
        • qInfo object
          Required
          Show qInfo properties
          • qId string

            Variable ID.

        • qName string
          Required

          Variable name.

        • qComment string

          Comment regarding the variable.

        • qDefinition string

          Variable definition.

        • qNumberPresentation object

          Defines the format of the value.

        • qIncludeInBookmark boolean

          Include in bookmark flag.

      Returns
      • Promise
        Required

        Promise of a Variable model.

    • get() function
      Required

      Get a variable by ID.

      Introduced in Qlik Sense 2.1.

      Parameters
      • qId string
        Required

        Variable ID.

      Returns
      • Promise
        Required

        Promise of a Variable model.

    • getByName() function
      Required

      Get a variable by name.

      Introduced in Qlik Sense 2.1.

      Parameters
      • qName string
        Required

        Variable name.

      Returns
      • Promise
        Required

        A promise of a Variable model.

    • getContent() function
      Required

      Get variable content.

      Parameters
      • name string
        Required

        Variable name.

      • Required

        Callback to receive the content.

        Show callback properties
        • getContentCallback() function
          Required
          Parameters
          • data object
            Required

            Content of the variable.

            Show data properties
            • qContent object
              Required

              Value of the variable.

              Show qContent properties
              • qString string
                Required

                Textual value of the variable.

              • qIsNum number
                Required

                Numeric value of the variable, if the value can be converted into a number.

          • qapp object
            Required

            The qlik.app object wrapping the app.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • setContent() function Deprecated
      Required

      Set variable content.

      Parameters
      • name string
        Required

        Variable name.

      • content string
        Required

        Variable content.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • setNumValue() function
      Required

      Set variable numeric value.

      Introduced in Qlik Sense 2.1.

      Parameters
      • qName string
        Required

        Variable name.

      • qVal number
        Required

        Variable value.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • setStringValue() function
      Required

      Set variable string value.

      Introduced in Qlik Sense 2.1.

      Parameters
      • qName string
        Required

        Variable name.

      • qVal string
        Required

        Variable value.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

  • visualization QAppVisualization
    Required
    Show visualization properties
    • create() function
      Required

      Create a new visualization. The visualization will be based on a session object and not persisted in the app.

      Parameters
      • type string
        Required

        Visualization type. Built-in visualization like barchart, piechart, linechart, combochart or an extension.

      • cols Array< string  |  NxDimension  |  NxMeasure >

        Column definitions, dimensions and measures. Each entry can be a string, an NxDimension or NxMeasure structure. If the NxDimension or NxMeasure refers to a library dimension or measure, you also might need to add qType measure or dimension.

      • options object

        Options to set. Refer to documentation for the visualization used for additional options.

        Show options properties
        • title string  |  Expression

          Visualization title.

        • showTitles boolean

          Show title for visualization. Default true.

        • subtitle string  |  Expression

          Visualization subtitle.

        • footnote string  |  Expression

          Visualization footnote.

      Returns
    • get() function
      Required

      Get an existing visualization.

      Introduced in Qlik Sense 2.2.

      Parameters
      • id string
        Required

        ID for an existing visualization.

      Returns

QApp addAlternateState(qStateName) function

Add an alternate state.

Introduced in Qlik Sense 1.1.

Parameters

  • qStateName string
    Required

    Alternate state name.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

addAlternateState

app.addAlternateState("X");

QApp back() function

Back to prev selection.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

back

var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.back();

QApp clearAll(lockedAlso?, state?) function

Clear all selections.

Parameters

  • lockedAlso boolean

    Also clear locked fields. Since Qlik Sense 2.1

  • state string

    Alternate state name. Since Qlik Sense 2.1

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

clearAll

var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.clearAll();

QApp close() function

Close an app.

Will also close the web socket and clear out client side data.

Introduced in Qlik Sense 1.1

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

close

var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.close();

QApp createCube(qHyperCubeDef, callback?) function

Defines a Qlik Hypercube and registers a callback to receive the data.

Parameters

  • qHyperCubeDef object
    Required

    Cube definition.

  • callback function

    Callback method. Parameter will contain a qHyperCube.

Returns

  • Promise
    Required

    A promise of an object model.

createCube

app.createCube({
  qDimensions : [{
    qDef : {
      qFieldDefs : ["FirstName"]
    }
  }, {
    qDef : {
      qFieldDefs : ["LastName"]
  }
}],
qMeasures : [{
  qDef : {
    qDef : "1"
  }
}],
qInitialDataFetch : [{
  qTop : 0,
  qLeft : 0,
  qHeight : 20,
  qWidth : 3
}]
}, function(reply) {
  var str = "";
  $.each(reply.qHyperCube.qDataPages[0].qMatrix, function(key, value) {
    str += '<li>' + value[0].qText + ':' + value[1].qText + '</li>';
  });
  $('#list').html(str);
});

QApp createGenericObject(param, callback?) function

Creates a Qlik Generic object and registers a callback to receive the data. The generic object can contain qHyperCubeDef, qListObjectDef and/or qStringExpression and qValueExpression. It will be a session object and disppears when the session is closed. The callback method will be called whenever the selection state changes in a way that affects the generic object. The parameter will be the evaluated version of the definition.

Parameters

  • param object
    Required

    Generic object definition.

  • callback function

    Callback method.

Returns

  • Promise
    Required

    A promise of an object model.

createGenericObject

app.createGenericObject( {
  user: {
    qStringExpression: "=QVUser ()"
  },
  version : {
    qStringExpression: "=QlikViewVersion ()"
  },
  fields: {
    qValueExpression: "=Count (DISTINCT $Field)"
  }
}, function ( reply ) {
  var str = "Version:" + reply.version + " Fields:" + reply.fields;
  if ( reply.user ) {
    str += " User:" + reply.user;
  }
  $( "#info" ).html(str);
});

QApp createList(qListObjectDef, callback?) function

Defines a Qlik list of field values and registers a callback to receive the data.

Parameters

  • qListObjectDef object
    Required

    List definition.

  • callback function

    Callback method. Parameter will contain a qListObject.

Returns

  • Promise
    Required

    A promise of an object model.

createList

app.createList({
  "qDef": {
    "qFieldDefs": [
      "LastName"
    ]
   },
   "qInitialDataFetch": [{
     qTop : 0,
     qLeft : 0,
     qHeight : 20,
     qWidth : 1
   }]
   }, function(reply) {
     var str = "";
     $.each(reply.qListObject.qDataPages[0].qMatrix, function(key, value) {
       str += '<li>' + value[0].qText + '</li>';
     });
     $('#list').html(str);
   });

QApp createTable(dimensions, measures, options?) function

Defines a Qlik Hypercube and creates a table object wrapping the hypercube.

Introduced in Qlik Sense 2.1.

Parameters

  • dimensions Array< string  |  NxDimension >
    Required

    Dimensions to use. Should be a field name or a NxDimension structure for each entry.

  • measures Array< string  |  NxMeasure >
    Required

    Measures to use. Should be an expression or a NxMeasure structure for each entry.

  • options object

    Options to set.

Returns

  • Required

    A table object of type QTable, which is initially empty but eventually will contain data. The table object will be updated when selection state changes.

    Show properties
    • rows Array< QRow >
      Required

      Data rows.

    • headers Array< QHeader >
      Required

      Header information.

    • totals Array< QMeasureCell >
      Required

      Total information for measures.

    • rowCount number
      Required

      Total number of rows for the qHyperCube, including rows not fetched from server.

    • colCount number
      Required

      Total number of columns for the qHyperCube.

    • exportData() function
      Required

      Export data of the underlying hyperCube in OOXML or CSV format.

      Note: The entire hyperCube will be exported, not just the current data-page. On Cloud this functionality will go through the Reports API, which limits the available options

      Parameters
      • options object
        Show options properties
        • format string

          Data format. Can be one of: OOXML (open XML, default), CSV_C (comma separated CSV), CSV_T (tab separated CSV)

        • filename string

          This parameter is optional and only used in desktop. Sets the name of the exported file when downloaded. Example: filename(guid).xlsx.

        • state string

          Can be: A: all values, P: possible values (default)

        • download boolean

          Automatically start download of file (with window.open), defaults to false.

      • callback function

        Callback function returning the link to the exported file.

    • getColByName() function
      Required

      Get column number for a given field name.

      Parameters
      • fld string
        Required

        Field name.

      Returns
      • number
        Required

        Column number, starting with zero. Undefined if no column with that name.

    • getMoreData() function
      Required

      Get more data for your qHyperCube.

createTable

var users = app.createTable(["FirstName", "LastName"], ["Count(Case Id)"],{rows:200});

QApp destroySessionObject(id) function

Destroys a Qlik Session object created with createGenericObject or any of createCube, createList, or getList calls.

The object will be removed from engine, no more updates will be sent to the client and all methods on the object will be invalid.

Introduced in Qlik Sense 1.1.

Parameters

  • id string
    Required

    Session object ID.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

destroySessionObject

app.destroySessionObject( 'xcVtY');
app.destroySessionObject(reply.qInfo.qId);

QApp doReload(qMode?, qPartial?, qDebug?) function

Reload the app.

Introduced in Qlik Sense 1.1

Parameters

  • qMode number

    Error handling mode: 0 = default mode, 1 = attempt recovery on all errors, 2 = fail on all errors.

  • qPartial boolean

    Set to true for partial reload.

  • qDebug boolean

    Set to true if debug breakpoints are honored. Execution of the script will be in debug mode.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

doReload

app.doReload();

QApp doSave(qFileName?) function

Save the app.

Introduced in Qlik Sense 1.1.

Parameters

  • qFileName string

    File name of the file to save.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

doSave

app.doReload().then(function(){
   app.doSave();
});

QApp field(fld, statename?) function

Get a field reference with methods to manipulate field.

Parameters

  • fld string
    Required

    Name of the field.

  • statename string

    Alternate state name.

Returns

  • Required

    A QField object with methods and properties that can be used to manipulate the field.

    Show properties
    • clear() function
      Required

      Clears a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • clearOther() function
      Required

      Clears all field selections except this one.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • getData() function
      Required

      Gets field data. The values are available as QFieldValue in array field.rows and is updated when the selection state changes. Notification OnData will be triggered after each update.

      Introduced in Qlik Sense 2.1

      Parameters
      • options object

        Object containing options for the getData call.

        Show options properties
        • rows number

          Number of rows to fetch. Default 200.

        • frequencyMode string

          Sets the qFrequencyMode. V=Absolute, P=Percent, R=Relative, N=No frequency. Default V.

      Returns
    • getMoreData() function
      Required

      Get more data for your field. Notification OnData will be triggered when complete.

      Introduced in Qlik Sense 2.1

      Returns
    • lock() function
      Required

      Locks a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • Required

      OnData notification

      Show OnData properties
      • bind() function
        Required

        Observe a Notification by sending in an observer function.

        Parameters
        • observer function
          Required

          The observer function to handle the notification.

      • unbind() function
        Required

        Stop observing a notification.

        Parameters
        • observer function
          Required

          The observer function that now should ignore any future notifications.

    • qStateCounts object
      Required

      Object with number of values in different states. Only after getData() call.

      Introduced in Qlik Sense 2.1.

    • rowCount number
      Required

      Number of different values. Only after getData() call.

      Introduced in Qlik Sense 2.1.

    • rows Array< QFieldValue >
      Required

      Field values. You need to call getData() method to make this available. Since Qlik Sense 2.1.

    • select() function
      Required

      Select field values using indexes.

      Parameters
      • Array Array< any >
        Required

        of indexes to values to select.

      • toggle boolean

        If true, toggle selected state.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectAll() function
      Required

      Select all values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectAlternative() function
      Required

      Select alternative values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectExcluded() function
      Required

      Select excluded values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectMatch() function
      Required

      Select matching field values.

      Parameters
      • match string
        Required

        Match string.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectPossible() function
      Required

      Select possible values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectValues() function
      Required

      Select field values.

      Parameters
      • values Array< object >
        Required

        Array of qFieldValues to select. Since 1.1, a simplified syntax with strings OR numbers also works. Note that for a numeric field, you need to provide the numeric value.

      • toggle boolean

        If true, toggle selected state. If false replace the current selection.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • toggleSelect() function
      Required

      Toggle field selection.

      Parameters
      • match string
        Required

        Match string.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • unlock() function
      Required

      Unlocks a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

QApp forward() function

Forward

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

forward

var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.forward();

QApp getAppLayout(callback?) function

Get layout for this app and register a callback to receive the data.

Introduced in Qlik Sense 1.1.

Parameters

  • callback function

    Callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getAppLayout

app.getAppLayout(function(layout){
  console.log(layout.qTitle);
});

QApp getAppObjectList(type?, callback?) function

Deprecated

Get a list of Qlik application objects and register a callback to receive the data.

Parameters

  • type string

    Type of object. One of: sheet, MasterObject.

  • callback function

    Callback method.

getAppObjectList

app.getAppObjectList( 'sheet', function(reply){
  var str = "";
  $.each(reply.qAppObjectList.qItems, function(key, value) {
    str +=  value.qData.title + ' ';
    $.each(value.qData.cells, function(k,v){
      str +=  v.name + ' ';
    });
  });
  console.log(str);
});

QApp getFullPropertyTree(id) function

Get properties for a Qlik object including children properties.

Parameters

  • id string
    Required

    Object ID.

Returns

  • Promise
    Required

    A promise of an object model.

getFullPropertyTree

app.getFullPropertyTree(value.qInfo.qId).then(function(model){
  console.log(model.propertyTree.qChildren.length + ' children');
});

QApp getList(type, callback?) function

Get a list of internal Qlik objects and register a callback to receive the data.

Parameters

  • type string
    Required

    Type of object. One of: FieldList, MeasureList, DimensionList, BookmarkList, SelectionObject, SnapshotList Since Qlik Sense 1.1, MediaList Since Qlik Sense 1.1, sheet Since Qlik Sense 1.1, MasterObject Since Qlik Sense 1.1, VariableList Since Qlik Sense 2.0, story Since Qlik Sense 2.1

  • callback function

    Registers a callback that is executed every time data is returned.

Returns

  • Promise
    Required

    A promise of an object model.

getList

app.getList("FieldList", function(reply){
  var str = "";
  $.each(reply.qFieldList.qItems, function(key, value) {
    str +=  value.qName + ' ';
  });
 console.log(str);
});

QApp getObject(elem?, id, options?) function

Inserts a Qlik object into an HTML element. The object will fill the HTML object, so you can size and position the element to determine how large the Qlik object will be.

If you only supply one parameter, you will just get the model without displaying the object.

Parameters

  • elem HTMLElement  |  string

    HTML element. Since version 1.1, it is also possible to define a string of the HTML element ID.

  • id string
    Required

    Object ID or 'CurrentSelections' if used for Selections bar. Since version November 2017 it is also possible to use 'AppNavigationBar' to on-demand app navigation bar.

  • options object

    Additional options.

    Show options properties
    • noInteraction boolean

      Set to true if you want to disable interaction, including selections, in the visualization. Since Qlik Sense 1.1

    • noSelections boolean

      Set to true if you want to disable selections in the visualization. Since Qlik Sense 3.0

    • variant string

      used only when getting 'CurrentSelections', for rendering the "dark" variant. Possible values: "dark".

    • sheetId string

      Sheet id where App Navigation bar exists. (only applies if id='AppNavigationBar') Since Qlik Sense November 2017

    • openAppCallback function

      Used if you want to handle what happens when user clicks the 'open generated app' button. Otherwise by default generated app is opened in new tab. Callback returns appId and targetSheetId. (only applies if id='AppNavigationBar') Since Qlik Sense November 2017

Returns

  • Promise
    Required

    A promise of an object model.

getObject

app.getObject(document.getElementById("LB01"), "uPyZavD");
app.getObject("LB01","uPyZavD");
app1.getObject('MyAppNavigationToolbarDIVid', 'AppNavigationBar', { sheetId: "RWcstb", openAppCallback: function ( appId, targetSheetId ) {
  console.log("Open generated app event handled.  App ID: " + appId + " target sheet to open by default: " + targetSheetId);
}});

QApp getObjectProperties(id) function

Get properties for a Qlik object.

Parameters

  • id string
    Required

    Object ID.

Returns

  • Promise
    Required

    A promise of an object model.

getObjectProperties

app.getObjectProperties("uPyZavD").then(function(model){
  this.title = model.properties.title;
});

QApp getScript() function

Gets the data load script of this app.

Introduced in Qlik Sense 4.0

Returns

  • Promise
    Required

    A promise of a qScript object with the load script values.

getScript

var app = qlik.openApp( "MY_APP_ID");
app.getScript().then( function(script){
  console.log(script);
});

QApp getSnapshot(element?, id) function

Inserts a Qlik snapshot into an HTML element. The snapshot will fill the HTML object, so you can size and position the element to determine how large the Qlik object will be.

If you only supply one parameter you will just get the model without displaying the object.

Parameters

  • element HTMLElement  |  string

    HTML element or string with HTML element id.

  • id string
    Required

    Snapshot ID.

Returns

  • Promise
    Required

    A promise of an object model.

getSnapshot

app.getSnapshot(document.getElementById("SNAPSHOT"), "uPyZavD");

QApp lockAll(state?) function

Lock all selections.

Parameters

  • state string

    Alternate state name. Since Qlik Sense 2.1.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

lockAll

var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.lockAll();

QApp off(eventName?) function

Remove listener(s) for the app events.

Introduced in Qlik Sense February 2018.

Parameters

  • eventName string

    Name of the event. Can be: error, warning, closed. If no eventName is provided, removes all listeners.

off

var app = qlik.openApp("MY_APP_ID");
app.on("error", function ( error ) {
  console.log("error listener called for app", error);
});
app.off("error");

QApp on(eventName, callback) function

Add listener(s) to the app events. Possible events are error, warning and closed. Multiple listeners can be added to an event.

Introduced in Qlik Sense February 2018.

Parameters

  • eventName string
    Required

    Name of the event. Can be: error, warning, closed.

  • callback function
    Required

    Callback method.

on

var app = qlik.openApp("MY_APP_ID");
app.on("error", function ( error ) {
  console.log("error listener called for app", error);
});
app.on("warning", function ( warning ) {
  console.log("warning listener called for app", warning);
});
app.on("closed", function ( closed ) {
  console.log("closed listener called for app", closed);
});

QApp removeAlternateState(qStateName) function

Remove an alternate state.

Introduced in Qlik Sense 1.1.

Parameters

  • qStateName string
    Required

    Alternate state name

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

removeAlternateState

app.removeAlternateState("X");

QApp searchAssociations(qTerms, qPage, qOptions?, callback?) function

Deprecated

Searches for one or more terms in the values of an app.

Introduce in Qlik Sense 1.1.

Parameters

  • qTerms Array< string >
    Required

    Terms to search for.

  • qPage object
    Required
    Show qPage properties
    • qOffset number
      Required

      Position from the top, starting from 0.

    • qCount number
      Required

      Number of search results to return.

    • qMaxNbrFieldMatches number
      Required

      Maximum number of matching values to return per search result.

  • qOptions object

    Search options.

    Show qOptions properties
    • qSearchFields Array< string >

      List of search fields.

    • qContext string

      Search context. Can be one of: Cleared, LockedFieldsOnly, CurrentSelections.

  • callback function

    Callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

searchAssociations

app.searchAssociations(["se"],
  {qOffset:0,qCount:15,qMaxNbrFieldMatches:5},
  {qContext: 'CurrentSelections'},
  function(reply){
    var str = "";
    reply.qResults.qFieldDictionaries.forEach(function(dic){
      dic.qResult.forEach(function(result){
        str += result.qText;
      });
    });
    console.log(str);
});

QApp searchResults(qTerms, qPage, qOptions?, callback?) function

Searches for one or more terms in the values of an app.

Introduced in Qlik Sense 2.2.

Parameters

  • qTerms Array< string >
    Required

    Terms to search for.

  • qPage object
    Required
    Show qPage properties
    • qOffset number
      Required

      Position from the top, starting from 0.

    • qCount number
      Required

      Number of search results to return.

    • qGroupOptions Array< SearchGroupOptions >

      Options of the search groups. If this property is not set, all values are returned.

    • qGroupItemOptions Array< SearchGroupItemOptions >

      Options of the search group items. If this property is not set, all values are returned.

  • qOptions object

    Search options.

    Show qOptions properties
    • qSearchFields Array< string >

      List of search fields.

    • qContext string

      Search context. Can be one of: Cleared, LockedFieldsOnly, CurrentSelections.

  • callback function

    Callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

searchResults

app.searchResults( ["ma"],
  { qOffset: 0, qCount: 15},
  {qContext: 'CurrentSelections'},
  function ( reply ) {
    if ( reply.qResult.qTotalNumberOfGroups === 0 ) {
      console.log('No matches');
    } else {
      var str = "";
      reply.qResult.qSearchGroupArray.forEach( function ( value ) {
        value.qItems.forEach( function ( item ) {
          str += item.qIdentifier +": ";
          item.qItemMatches.forEach( function ( match ) {
            str += match.qText + ' ';
          });
        });
      });
      console.log(str);
    }
});

QApp searchSuggest(qTerms, qOptions?, callback?) function

Returns search suggestions.

Introduced in Qlik Sense 1.1.

Parameters

  • qTerms Array< string >
    Required

    Terms to search for.

  • qOptions object

    Search options.

    Show qOptions properties
    • qSearchFields Array< string >

      List of search fields.

  • callback function

    Callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

searchSuggest

app.searchSuggest(["se"], {}, function(reply) {
  var str = "";
  reply.qResult.qSuggestions.forEach(function(sugg){
    str += sugg.qValue + ' ';
  });
  console.log(str);
});

QApp selectAssociations(qMatchIx?, qTerms?, qOptions?, qSoftLock?) function

Make a selection based on searchAssociaton results.

Introduced in Qlik Sense 1.1.

Parameters

  • qMatchIx number

    Index to search result.

  • qTerms Array< string >

    Values to select.

  • qOptions object

    Parameter sent to the Qlik engine containing information about the search fields and the search context.

    Show qOptions properties
    • qSearchFields Array< string >

      List of the search fields. If empty, the search is performed in all fields of the app.

    • qContext string

      Search context. Can be one of: Cleared, LockedFieldsOnly, CurrentSelections.

  • qSoftLock boolean

    Use the qOptions.qContext parameter instead.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

selectAssociations

app.selectAssociations( 0, ["May","Mar"] );

QApp selectionState(state?) function

Creates a SelectionState object that encapsulates the selection state.

Introduced in Qlik Sense 2.2.

Parameters

  • state string

    Sets the state.

Returns

  • A selection state object for the selection state of type QSelectionState.

    Show properties
    • stateName string
      Required

      State name, '$' for default state.

    • selections Array< QFieldSelections >
      Required

      Selections

    • backCount number
      Required

      Number of back steps available.

    • forwardCount number
      Required

      Number of forward steps available.

    • Required

      OnData notification.

    • clearAll() function
      Required

      Clear all selections in this state.

      Parameters
      • lockedAlso boolean

        Clear locked fields also.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • lockAll() function
      Required

      Lock all selections in this state.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply.

    • unlockAll() function
      Required

      Unlock all selections in this state.

      Returns
      • Promise
        Required

        A promise of a Qlik engine reply

QApp setScript(script) function

Sets the data load script of this app. Also validates the script syntax and returns the syntax errors if errors exist.

Introduced in Qlik Sense 4.0.

Parameters

  • script string
    Required

    The script content.

Returns

  • Promise
    Required

    A promise of an empty object or a list of syntax errors depending on the validation result.

setScript

Load script inline

var script = "Load Chr(RecNo()+Ord('A')-1) as Alpha, RecNo() as Num autogenerate 26;"
var app = qlik.openApp( "MY_APP_ID");
app.setScript(script).then( function(result){
	console.log(result);
});

Load script from file

var script = 'LOAD Sales FROM [lib://data/sample.xlsx];';
var app = qlik.openApp( "MY_APP_ID");
app.setScript(script).then( function(result){
  console.log(result);
});

QApp unlockAll(state?) function

Unlock all selections.

Parameters

  • state string

    Alternate state name. Since Qlik Sense 2.1.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

unlockAll

var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.unlockAll();

new QAppTheme() class

QAppTheme get(id?) function

Get theme as a QTheme object.

Parameters

  • id string

    Theme ID. If no ID is specified, the theme saved for the app is returned.

Returns

  • Promise < QTheme >
    Required

    A promise of a QTheme object.

get

app.theme.get('my-theme-id').then(function(qtheme){
   console.log('Theme background color: ' + qtheme.properties.backgroundColor);
	});

QAppTheme getApplied() function

Get currently applied theme as a QTheme object.

Returns

  • Promise < QTheme >
    Required

    A promise of a QTheme object.

getApplied

app.theme.getApplied().then(function(qtheme){
   console.log('Current theme background color: ' + qtheme.properties.backgroundColor);
	});

QAppTheme save(id) function

Save a theme ID of an app.

Introduced in Qlik Sense February 2018.

Parameters

  • id string
    Required

    Theme ID.

save

app.theme.save('my-theme-id');

new QAppVisualization() class

QAppVisualization create(type, cols?, options?) function

Create a new visualization. The visualization will be based on a session object and not persisted in the app.

Parameters

  • type string
    Required

    Visualization type. Built-in visualization like barchart, piechart, linechart, combochart or an extension.

  • cols Array< string  |  NxDimension  |  NxMeasure >

    Column definitions, dimensions and measures. Each entry can be a string, an NxDimension or NxMeasure structure. If the NxDimension or NxMeasure refers to a library dimension or measure, you also might need to add qType measure or dimension.

  • options object

    Options to set. Refer to documentation for the visualization used for additional options.

    Show options properties
    • title string  |  Expression

      Visualization title.

    • showTitles boolean

      Show title for visualization. Default true.

    • subtitle string  |  Expression

      Visualization subtitle.

    • footnote string  |  Expression

      Visualization footnote.

Returns

create

create a barchart on the fly
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.create('barchart',["Case Owner Group","=Avg([Case Duration Time])"],{title:"Great on-the-fly barchart"}).then(function(bar){
  bar.show('QV04');
});
create a table
app.visualization.create( 'table', ["Case Owner Group", "=Avg([Case Duration Time])", "Priority", "Quarter"] ).then( function ( table ) {
  table.show( 'QV04' );
});
create a toolbar using an extension
app.visualization.create('com-qliktech-toolbar',null,
  {"buttons":{"clear":true,"back":true,"forward":true}}).then(function(vis){
    vis.show("QV05");
});

QAppVisualization get(id) function

Get an existing visualization.

Introduced in Qlik Sense 2.2.

Parameters

  • id string
    Required

    ID for an existing visualization.

Returns

get

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
   app.visualization.get('xGhjKl').then(function(vis){
     vis.show("QV01");
   });

new QBookmark() class

QBookmark apply(id) function

Apply bookmark.

Parameters

  • id string
    Required

    Bookmark ID.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply. Since Qlik Sense 1.2.

apply

var app = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d");
app.bookmark.apply("pPvpTN");

QBookmark create(title, description, sheetId?) function

Create bookmark based on current selection.

Parameters

  • title string
    Required

    Bookmark title.

  • description string
    Required

    Bookmark description.

  • sheetId string

    Bookmark sheet ID. Since Qlik Sense 2.2.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply. Since Qlik Sense 1.2.

create

var app = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d");
app.bookmark.create("Test","Test bookmark","fmcJkH");

QBookmark remove(id) function

Remove bookmark.

Parameters

  • id string
    Required

    Bookmark ID.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply. Since Qlik Sense 1.2.

remove

var app = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d");
app.bookmark.remove("pPvpTN");

new QDimensionCell() class

Wrapper around a HyperCube dimension cell.

Properties

  • qText string
    Required

    Cell value formatted as set up in properties.

  • qElemNumber number
    Required

    Cell value index.

  • qState string
    Required

    Cell state.

  • qNum number

    Cell numeric value, if cell is numeric.

QDimensionCell select() function

Select the value contained in this cell.

select

<div class="selectable" ng-class="{'selected':cell.selected}" ng-click="cell.select($event)">{{cell.qText}}</div>

new QField() class

External interface to the fields in a Qlik Sense app and contains methods for field level commands.

Properties

  • Required

    OnData notification

    Show OnData properties
    • bind() function
      Required

      Observe a Notification by sending in an observer function.

      Parameters
      • observer function
        Required

        The observer function to handle the notification.

    • unbind() function
      Required

      Stop observing a notification.

      Parameters
      • observer function
        Required

        The observer function that now should ignore any future notifications.

  • qStateCounts object
    Required

    Object with number of values in different states. Only after getData() call.

    Introduced in Qlik Sense 2.1.

  • rowCount number
    Required

    Number of different values. Only after getData() call.

    Introduced in Qlik Sense 2.1.

  • rows Array< QFieldValue >
    Required

    Field values. You need to call getData() method to make this available. Since Qlik Sense 2.1.

QField clear() function

Clears a field selection.

Returns

  • Promise
    Required

    A promise of an engine response.

clear

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').clear();

QField clearOther(softlock?) function

Clears all field selections except this one.

Parameters

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

clearOther

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').clearOther(true);

QField getData(options?) function

Gets field data. The values are available as QFieldValue in array field.rows and is updated when the selection state changes. Notification OnData will be triggered after each update.

Introduced in Qlik Sense 2.1

Parameters

  • options object

    Object containing options for the getData call.

    Show options properties
    • rows number

      Number of rows to fetch. Default 200.

    • frequencyMode string

      Sets the qFrequencyMode. V=Absolute, P=Percent, R=Relative, N=No frequency. Default V.

Returns

getData

var app = qlik.openApp("c31e2aba-3b46-4b13-8b87-c5c2514dea1d");
$scope.months = app.field("Month").getData();

<button ng-repeat="row in months.rows" class="btn" ng-click="row.select();"
  ng-class="{'btn-success':row.qState === 'S'}">{{row.qText}}</button>

QField getMoreData() function

Get more data for your field. Notification OnData will be triggered when complete.

Introduced in Qlik Sense 2.1

Returns

getMoreData

<button ng-if="fieldMonth.rowCount>fieldMonth.rows.length" ng-click="fieldMonth.getMoreData()">More</button>

QField lock() function

Locks a field selection.

Returns

  • Promise
    Required

    A promise of an engine response.

lock

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').lock();

QField select(Array, toggle?, softlock?) function

Select field values using indexes.

Parameters

  • Array Array< any >
    Required

    of indexes to values to select.

  • toggle boolean

    If true, toggle selected state.

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

select

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').select([0, 1, 2], true, true);

QField selectAll(softlock?) function

Select all values in field.

Parameters

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

selectAll

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').selectAll();

QField selectAlternative(softlock?) function

Select alternative values in field.

Parameters

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

selectAlternative

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').selectAlternative();

QField selectExcluded(softlock?) function

Select excluded values in field.

Parameters

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

selectExcluded

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').selectExcluded();

QField selectMatch(match, softlock?) function

Select matching field values.

Parameters

  • match string
    Required

    Match string.

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

selectMatch

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').selectMatch('A', true);

QField selectPossible(softlock?) function

Select possible values in field.

Parameters

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

selectPossible

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').selectPossible();

QField selectValues(values, toggle?, softlock?) function

Select field values.

Parameters

  • values Array< object >
    Required

    Array of qFieldValues to select. Since 1.1, a simplified syntax with strings OR numbers also works. Note that for a numeric field, you need to provide the numeric value.

  • toggle boolean

    If true, toggle selected state. If false replace the current selection.

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

selectValues

app.field("Month").selectValues([5], true, true);
app.field(fld).selectValues(["Wetterberg"], true, true);

QField toggleSelect(match, softlock?) function

Toggle field selection.

Parameters

  • match string
    Required

    Match string.

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise of an engine response.

toggleSelect

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').toggleSelect('A', true);

QField unlock() function

Unlocks a field selection.

Returns

  • Promise
    Required

    A promise of an engine response.

unlock

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').unlock();

new QFieldSelections() class

Selection state for a field.

Introduced in Qlik Sense 2.2.

Properties

  • fieldName string
    Required

    The field name.

  • qSortIndex number
    Required

    Sort index, starting from 0.

  • Required

    Reference to the field.

    Show field properties
    • clear() function
      Required

      Clears a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • clearOther() function
      Required

      Clears all field selections except this one.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • getData() function
      Required

      Gets field data. The values are available as QFieldValue in array field.rows and is updated when the selection state changes. Notification OnData will be triggered after each update.

      Introduced in Qlik Sense 2.1

      Parameters
      • options object

        Object containing options for the getData call.

        Show options properties
        • rows number

          Number of rows to fetch. Default 200.

        • frequencyMode string

          Sets the qFrequencyMode. V=Absolute, P=Percent, R=Relative, N=No frequency. Default V.

      Returns
    • getMoreData() function
      Required

      Get more data for your field. Notification OnData will be triggered when complete.

      Introduced in Qlik Sense 2.1

      Returns
    • lock() function
      Required

      Locks a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • Required

      OnData notification

      Show OnData properties
      • bind() function
        Required

        Observe a Notification by sending in an observer function.

        Parameters
        • observer function
          Required

          The observer function to handle the notification.

      • unbind() function
        Required

        Stop observing a notification.

        Parameters
        • observer function
          Required

          The observer function that now should ignore any future notifications.

    • qStateCounts object
      Required

      Object with number of values in different states. Only after getData() call.

      Introduced in Qlik Sense 2.1.

    • rowCount number
      Required

      Number of different values. Only after getData() call.

      Introduced in Qlik Sense 2.1.

    • rows Array< QFieldValue >
      Required

      Field values. You need to call getData() method to make this available. Since Qlik Sense 2.1.

    • select() function
      Required

      Select field values using indexes.

      Parameters
      • Array Array< any >
        Required

        of indexes to values to select.

      • toggle boolean

        If true, toggle selected state.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectAll() function
      Required

      Select all values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectAlternative() function
      Required

      Select alternative values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectExcluded() function
      Required

      Select excluded values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectMatch() function
      Required

      Select matching field values.

      Parameters
      • match string
        Required

        Match string.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectPossible() function
      Required

      Select possible values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectValues() function
      Required

      Select field values.

      Parameters
      • values Array< object >
        Required

        Array of qFieldValues to select. Since 1.1, a simplified syntax with strings OR numbers also works. Note that for a numeric field, you need to provide the numeric value.

      • toggle boolean

        If true, toggle selected state. If false replace the current selection.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • toggleSelect() function
      Required

      Toggle field selection.

      Parameters
      • match string
        Required

        Match string.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • unlock() function
      Required

      Unlocks a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

  • locked boolean
    Required

    Is field locked?

  • isNumeric boolean
    Required

    Is field numeric?

  • totalCount number
    Required

    Total number of values in field.

  • selectedCount number
    Required

    Number of selected values.

  • qSelectionThreshold number
    Required

    Number of values that will be listed.

  • qStateCounts object
    Required

    Object with number of values in different states.

  • qSelected string
    Required

    Concatenated string of selected values if # of values are less than the threshold or string of format "7 of 123".

  • selectedValues Array< number >
    Required

    Array with a maximum of qSelectionThreshold values that are selected. For each value the text plus the selection mode (NORMAL/AND/NOT).

  • notSelectedValues Array< number >
    Required

    Array with a maximum of qSelectionThreshold values that are not selected. For each value the text plus the selection mode (NORMAL/AND/NOT).

new QFieldValue() class

Field value for a Qlik Field.

Properties

  • qText string
    Required

    Cell value formatted as set up in properties.

  • qElemNumber number
    Required

    Cell value index.

  • qState string
    Required

    Cell state.

  • qNum number

    Cell numeric value, if cell is numeric.

  • qFrequency string

    Frequency, if calculated by engine.

QFieldValue select(toggle?, softlock?) function

Select field value.

Introduced in Qlik Sense 2.1.

Parameters

  • toggle boolean

    If true, toggle selected state.

  • softlock boolean

    If true, locked selections can be overridden.

Returns

  • Promise
    Required

    A promise.

select

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
var field = app.field('LastName');
field.getData();
//after data is loaded fieldvalues will be in rows array
field.rows[0].select();

new QGlobal() class

QGlobal cancelReload() function

Cancel reload.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

cancelReload

var global = qlik.getGlobal(config);
global.cancelReload();

QGlobal getAppList(callback) function

Get app list.

Parameters

  • callback function
    Required

    callback method.

getAppList

qlik.getGlobal(config).getAppList(function(list){
  var str = "";
  $.each(list, function(key, value) {
    str +=  value.qDocName + '('+ value.qDocId + ')';
  });
  console.log(str);
});

QGlobal getAuthenticatedUser(callback?) function

Retrieves information about the authenticated user. Note: This method is only applicable to Qlik Sense Enterprise on Windows. For Qlik Sense Enterprise SaaS, use {@link https://qlik.dev/apis/rest/users#%23%2Fentries%2Fusers%2Fme-get|User API}

Parameters

  • callback function

    callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getAuthenticatedUser

var global = qlik.getGlobal(config);
global.getAuthenticatedUser(function(reply){
  console.log('User:'+reply.qReturn);
});

QGlobal getProductVersion(callback?) function

Deprecated

Get Product Version.

Introduced in Qlik Sense 1.2.

Parameters

  • callback function

    callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getProductVersion

var global = qlik.getGlobal(config);
global.getProductVersion(function(reply){
  console.log('Product Version:'+reply.qReturn);
});

QGlobal getProgress(qRequestId, callback?) function

Get Progress.

Introduced in Qlik Sense 2.1.

Parameters

  • qRequestId number
    Required

    RequestId from doReload call or 0. Complete information is returned if the identifier of the request is specified. If qRequestId = 0, less information is returned.

  • callback function

    callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getProgress

var global = qlik.getGlobal(config);
global.getProgress();

QGlobal getQTProduct(callback?) function

Get QT Product.

Parameters

  • callback function

    callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getQTProduct

var global = qlik.getGlobal(config);
global.getQTProduct(function(reply){
  console.log('QT Product:'+reply.qReturn);
});

QGlobal isPersonalMode(callback?) function

Get isPersonalMode.

Parameters

  • callback function

    callback method.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

isPersonalMode

var global = qlik.getGlobal(config);
global.isPersonalMode(function(reply){
  console.log('Personal mode:'+reply.qReturn);
});

QGlobal off(eventName?) function

Remove listener(s) for the global events.

Introduced in Qlik Sense February 2018.

Parameters

  • eventName string

    Name of the event. Can be: error, warning, closed. Removes all listeners if no eventName is provided.

off

var global = qlik.getGlobal(config);
global.on("error", function (error) {
  console.log("error listener called for global", error);
});
global.off("error");

QGlobal on(eventName, callback) function

Adds listeners to the global events. Possible events are error, warning, and closed. Multiple listeners can be added to an event.

Introduced in Qlik Sense February 2018

Parameters

  • eventName string
    Required

    Name of the event. Can be: error, warning, closed.

  • callback function
    Required

    Callback method.

on

var global = qlik.getGlobal(config);
global.on("error", function (error) {
  console.log("error listener called for global", error);
});
global.on("warning", function (warning) {
  console.log("warning listener called for global", warning);
});
global.on("closed", function (closed) {
  console.log("closed listener called for global", closed);
});

new QGlobalTheme() class

QGlobalTheme apply(id) function

Apply a theme to all visualizations on the web page.

Parameters

  • id string
    Required

    ID of theme to apply.

Returns

  • Promise < boolean >
    Required

    Promise of a boolean to indicate success or not.

apply

qlik.theme.apply('my-theme-id').then(function(result){
  console.log('theme applied with result: ' + result);
});

QGlobalTheme get(id) function

Get theme as a QTheme object.

Parameters

  • id string
    Required

    Theme id

Returns

  • Promise < QTheme >
    Required

    A promise of a QTheme object.

get

qlik.theme.get('my-theme-id').then(function(qtheme){
  console.log('Theme background color: ' + qtheme.properties.backgroundColor);
});

new QHeader() class

Wrapper around a HyperCube header cell.

Introduced in Qlik Sense 2.1.

Properties

  • qFallbackTitle string
    Required

    Column title.

  • qSortIndicator string
    Required

    A: ascending, D:Descending

  • isOrderedBy boolean
    Required

    Is this the first column for sort?

  • qReverseSort boolean
    Required

    Is sort order currently reversed for this column?

  • col number
    Required

    Column number.

  • qCardinal number

    Number of different values. Only for dimensions.

  • qStateCounts object

    Object with number of values in different states. Only for dimensions.

  • Field object with methods to manipulate the underlying field. Only used for dimensions.

    Show field properties
    • clear() function
      Required

      Clears a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • clearOther() function
      Required

      Clears all field selections except this one.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • getData() function
      Required

      Gets field data. The values are available as QFieldValue in array field.rows and is updated when the selection state changes. Notification OnData will be triggered after each update.

      Introduced in Qlik Sense 2.1

      Parameters
      • options object

        Object containing options for the getData call.

        Show options properties
        • rows number

          Number of rows to fetch. Default 200.

        • frequencyMode string

          Sets the qFrequencyMode. V=Absolute, P=Percent, R=Relative, N=No frequency. Default V.

      Returns
    • getMoreData() function
      Required

      Get more data for your field. Notification OnData will be triggered when complete.

      Introduced in Qlik Sense 2.1

      Returns
    • lock() function
      Required

      Locks a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • Required

      OnData notification

      Show OnData properties
      • bind() function
        Required

        Observe a Notification by sending in an observer function.

        Parameters
        • observer function
          Required

          The observer function to handle the notification.

      • unbind() function
        Required

        Stop observing a notification.

        Parameters
        • observer function
          Required

          The observer function that now should ignore any future notifications.

    • qStateCounts object
      Required

      Object with number of values in different states. Only after getData() call.

      Introduced in Qlik Sense 2.1.

    • rowCount number
      Required

      Number of different values. Only after getData() call.

      Introduced in Qlik Sense 2.1.

    • rows Array< QFieldValue >
      Required

      Field values. You need to call getData() method to make this available. Since Qlik Sense 2.1.

    • select() function
      Required

      Select field values using indexes.

      Parameters
      • Array Array< any >
        Required

        of indexes to values to select.

      • toggle boolean

        If true, toggle selected state.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectAll() function
      Required

      Select all values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectAlternative() function
      Required

      Select alternative values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectExcluded() function
      Required

      Select excluded values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectMatch() function
      Required

      Select matching field values.

      Parameters
      • match string
        Required

        Match string.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectPossible() function
      Required

      Select possible values in field.

      Parameters
      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • selectValues() function
      Required

      Select field values.

      Parameters
      • values Array< object >
        Required

        Array of qFieldValues to select. Since 1.1, a simplified syntax with strings OR numbers also works. Note that for a numeric field, you need to provide the numeric value.

      • toggle boolean

        If true, toggle selected state. If false replace the current selection.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • toggleSelect() function
      Required

      Toggle field selection.

      Parameters
      • match string
        Required

        Match string.

      • softlock boolean

        If true, locked selections can be overridden.

      Returns
      • Promise
        Required

        A promise of an engine response.

    • unlock() function
      Required

      Unlocks a field selection.

      Returns
      • Promise
        Required

        A promise of an engine response.

  • qMin number

    Minimum value. Only for measures.

  • qMax number

    Maximum value. Only for measures.

  • errorCode number

    Error code for this column. Only if column has an error. Since Qlik Sense 2.2.

  • errorMessage string

    Error message for this column. Only if column has an error. Since Qlik Sense 2.2.

QHeader

<th ng-repeat="head in data.headers" class="header" ng-click="head.orderBy()">
  {{head.qFallbackTitle}}
       <i ng-if="head.isOrderedBy" ng-click="head.reverseOrder()"
           ng-class="{ 'icon-triangle-top': head.qSortIndicator === 'A',
			'icon-triangle-bottom': head.qSortIndicator === 'D'}">
       </i>
</th>

QHeader orderBy() function

Set this column to be the first in the sort order.

QHeader reverseOrder() function

Reverse the sorting order for the column.

QHeader selectRange(min, max, inclMin?, inclMax?) function

Select a range in this measure.

Parameters

  • min number
    Required

    Sets the minimum value of the range.

  • max number
    Required

    Sets the maximum value of the range.

  • inclMin boolean

    Set to true to include minimum value.

  • inclMax boolean

    Set to true to include maximum value.

Returns

  • Promise
    Required

selectRange

this.table.headers[1].selectRange( this.minval, this.maxval );

new QMeasureCell() class

Wrapper around a HyperCube measure cell.

Properties

  • qText string
    Required

    Cell value formatted as set up in properties.

  • qNum number

    Cell numeric value, if cell is numeric.

QMeasureCell getPercent() function

Get the value of this cell as percent of total. Note that this might be more than 100% if this is an average.

getPercent

<div class="bar" style="width:{{row.measures[0].getPercent()}}%">

QMeasureCell getPercentOfMax() function

Get the value of this cell as percent of maximum.

getPercentOfMax

<div class="bar" style="width:{{row.measures[0].getPercentOfMax()}}%">

new QNavigation() class

Properties

  • ANALYSIS string
    Required

    Used for analysis mode.

  • EDIT string
    Required

    Used for edit mode.

QNavigation getCurrentSheetId() function

Get current sheet ID.

Returns

  • The result of the navigation

    Show properties
    • success boolean
      Required

      true if the navigation was successful.

    • sheetId string

      The new sheet ID.

    • error string

      The error code if an error occurred, for example, NOSUCHSHEET or NOCURRENTSHEET.

    • errorMsg string

      The error message, for example, 'No current sheet'.

getCurrentSheetId

var result = qlik.navigation.getCurrentSheetId();
console.log('sheet id: ' + result.sheetId);

QNavigation getMode() function

Get current mode.

Returns

  • string
    Required

    mode The current mode.

getMode

var mode = qlik.navigation.getMode();
console.log('mode: ' + mode);

QNavigation gotoSheet(sheetId) function

Navigates to a given sheet in the current app. Note that the method will return before the actual navigation takes place.

Parameters

  • sheetId string
    Required

    The ID of the sheet to navigate to.

Returns

gotoSheet

var navigationResult = qlik.navigation.gotoSheet('xYgfJ');

QNavigation gotoStory(storyId) function

Navigates to a given story in the current app. Note that the method will return before the actual navigation takes place.

Parameters

  • storyId string
    Required

    The ID of the story to navigate to.

Returns

  • The result of the navigation operation.

    Show properties
    • success boolean
      Required

      true if the navigation was successful.

    • storyId string

      The new story ID.

    • error string

      The error code if an error occurred, for example, NOSUCHSTORY.

    • errorMsg string

      The error message, for example, 'No such story'.

gotoStory

var navigationResult = qlik.navigation.gotoStory('xYgfJ');

QNavigation isModeAllowed(mode) function

Checks if a given mode is allowed.

Parameters

  • mode string
    Required

    The mode to check availability of. Can be either {@link QNavigaton#EDIT} or {@link QNavigaton#ANALYSIS}.

Returns

  • boolean
    Required

    If the mode is allowed or not.

isModeAllowed

if (qlik.navigation.isModeAllowed(QNavigation#EDIT)) {
  //enable edit button
};

QNavigation nextSheet() function

Navigates to the next sheet in the current app. It will do nothing if you do not have sheets in the current context. Note that the method will return before the actual navigation takes place.

Returns

nextSheet

var navigationResult = qlik.navigation.nextSheet();

QNavigation prevSheet() function

Navigates to the previous sheet in the current app. It will do nothing if you do not have sheets in the current context. Note that the method will return before the actual navigation takes place.

Returns

prevSheet

var navigationResult = qlik.navigation.prevSheet();

QNavigation setMode(mode) function

Set current mode.

Parameters

  • mode string
    Required

    The mode to change to. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.

Returns

  • The result of the mode change.

    Show properties
    • success boolean
      Required

      true if the operation was successful.

    • mode string

      The new mode. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.

    • error string

      The error code if an error occurred, for example, MODENOTALLOWED.

    • errorMsg string

      The error message, for example, 'Mode not allowed'.

setMode

var result = qlik.navigation.setMode(QNavigation#EDIT);
console.log('mode: ' + result.mode);

QNavigationModeResult object

Return value from mode related navigation methods.

Properties

  • success boolean
    Required

    true if the operation was successful.

  • mode string

    The new mode. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.

  • error string

    The error code if an error occurred, for example, MODENOTALLOWED.

  • errorMsg string

    The error message, for example, 'Mode not allowed'.

QNavigationSheetResult object

Return value from sheet navigation methods.

Properties

  • success boolean
    Required

    true if the navigation was successful.

  • sheetId string

    The new sheet ID.

  • error string

    The error code if an error occurred, for example, NOSUCHSHEET or NOCURRENTSHEET.

  • errorMsg string

    The error message, for example, 'No current sheet'.

QNavigationStoryResult object

Return value from story navigation methods.

Properties

  • success boolean
    Required

    true if the navigation was successful.

  • storyId string

    The new story ID.

  • error string

    The error code if an error occurred, for example, NOSUCHSTORY.

  • errorMsg string

    The error message, for example, 'No such story'.

new QRow() class

Wrapper around a HyperCube data row.

Properties

  • dimensions Array< QDimensionCell >
    Required

    Dimension cells.

  • measures Array< QMeasureCell >
    Required

    Measure cells.

  • cells Array< any >
    Required

    All cells, in the order defined in properties.

QRow

<div ng-repeat="row in data.rows" class="row"  title="{{row.dimensions[0].qText}}"
   data-value="{{ row.dimensions[0].qElemNumber }}">
   <div class="bar" style="width:{{row.measures[0].getPercent()}}%">
       <span>{{row.dimensions[0].qText}}</span>
   </div>
   <div class="per">
       <span class="{{row.measures[0].getPercent()>95 ? 'over':'' }}">{{row.measures[0].qText}}</span>
   </div>
</div>

new QSelectionState() class

The SelectionState API allows developers to work with selection state data returned from the Qlik engine without having deeper knowledge of internal constructs.

Notification is sent when data is available. Notification will be triggered after each update. To receive notification, bind a listener on 'OnData' of QSelectionState instance.

Properties

  • stateName string
    Required

    State name, '$' for default state.

  • selections Array< QFieldSelections >
    Required

    Selections

  • backCount number
    Required

    Number of back steps available.

  • forwardCount number
    Required

    Number of forward steps available.

  • Required

    OnData notification.

    Show OnData properties
    • bind() function
      Required

      Observe a Notification by sending in an observer function.

      Parameters
      • observer function
        Required

        The observer function to handle the notification.

    • unbind() function
      Required

      Stop observing a notification.

      Parameters
      • observer function
        Required

        The observer function that now should ignore any future notifications.

QSelectionState

// create an object
const selState = app.selectionState();

const listener = function() {
  console.log('Back count:' + selState.backCount);
  selState.OnData.unbind( listener );  //unregister the listener when no longer notification is needed.
};
selState.OnData.bind( listener ); //bind the listener
Example based on using AngularJS.

Your main script:

$scope.selState = app.selectionState();

In your AngularJS template:
<button type="button" class="btn btn-default btn-xs" ng-click="selState.clearAll()" aria-label="Clear">
  <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>

<li ng-repeat="sel in selState.selections">{{sel.fieldName}}: {{sel.qSelected}}
  <button type="button" class="btn btn-default btn-xs" ng-click="sel.field.clear()" aria-label="Lock">
    <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
  </button>
</li>

QSelectionState clearAll(lockedAlso?) function

Clear all selections in this state.

Parameters

  • lockedAlso boolean

    Clear locked fields also.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

clearAll

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
var selState = app.selectionState();
selState.clearAll(true);

QSelectionState lockAll() function

Lock all selections in this state.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

lockAll

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
var selState = app.selectionState();
selState.lockAll();

QSelectionState unlockAll() function

Unlock all selections in this state.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply

unlockAll

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
var selState = app.selectionState();
selState.unlockAll();

new QTable() class

The Table API allow developers to work with tabular data returned from the Qlik engine without having deeper knowledge of internal constructs like, for example, a hypercube. From a technical perspective it is a wrapper around HyperCube data from engine.

Notification is sent when data is available. Notification will be triggered after each update. To receive notification bind a listener on 'OnData' of QTable instance.

Properties

  • rows Array< QRow >
    Required

    Data rows.

  • headers Array< QHeader >
    Required

    Header information.

  • totals Array< QMeasureCell >
    Required

    Total information for measures.

  • rowCount number
    Required

    Total number of rows for the qHyperCube, including rows not fetched from server.

  • colCount number
    Required

    Total number of columns for the qHyperCube.

QTable

// Initialization using the hypercube of the current visualization
var table = qlik.table( this );

var listener = function() {
  var rowCount = table.rowCount;
  var colCount = table.colCount;
  table.OnData.unbind( listener );  //unregister the listener when no longer notification is needed.
};
table.OnData.bind( listener ); //bind the listener
// Example based on using AngularJS.

// Your main script:

if ( !this.$scope.table ) {
  this.$scope.table = qlik.table( this );
}

// In your AngularJS template:

<tr ng-repeat="row in table.rows">
   <td ng-repeat="cell in row.cells"> {{cell.qText}} </td>
</tr>

QTable exportData(options?, callback?) function

Export data of the underlying hyperCube in OOXML or CSV format.

Note: The entire hyperCube will be exported, not just the current data-page. On Cloud this functionality will go through the Reports API, which limits the available options

Parameters

  • options object
    Show options properties
    • format string

      Data format. Can be one of: OOXML (open XML, default), CSV_C (comma separated CSV), CSV_T (tab separated CSV)

    • filename string

      This parameter is optional and only used in desktop. Sets the name of the exported file when downloaded. Example: filename(guid).xlsx.

    • state string

      Can be: A: all values, P: possible values (default)

    • download boolean

      Automatically start download of file (with window.open), defaults to false.

  • callback function

    Callback function returning the link to the exported file.

exportData

var qTable = qlik.table(this);

var $exportButton = $( document.createElement('button'));
$exportButton.html('Export');
$exportButton.bind('click', function (  ) {
			qTable.exportData({download: true});
		});
$element.append($exportButton);
// Example using AngularJS in a Qlik Sense visualization extension:

// Main script:
...
paint: function ( ) {
		//setup scope.table
		if ( !this.$scope.table ) {
			this.$scope.table = qlik.table( this );
		}
	}
...

// In your template:
<button ng-click="table.exportData({download:true})">Create Excel file</button>

QTable getColByName(fld) function

Get column number for a given field name.

Parameters

  • fld string
    Required

    Field name.

Returns

  • number
    Required

    Column number, starting with zero. Undefined if no column with that name.

getColByName

var table = qlik.table( this );
var colNumber = table.getColByName('Closed cases');

QTable getMoreData() function

Get more data for your qHyperCube.

getMoreData

// Example based on using AngularJS in a Qlik Sense visualization extension.

// Main extension script file:
...
paint: function ( ) {
		//setup scope.data
		if ( !this.$scope.data ) {
			this.$scope.data = qlik.table( this );
		}
	}
...

// AngularJS template:
<button ng-if="data.rowcount>data.rows.length" ng-click="data.getMoreData()">More</button>

new QTheme() class

Wrapper for a theme with helper methods.

Introduced in Qlik Sense February 2018.

Properties

  • id string
    Required

    Theme id

  • properties object
    Required

    Theme properties tree structure with calculated styling values. Functions, variables, and inheritance have been computed from the original theme JSON file.

QTheme apply() function

Apply theme to all visualizations on the web page.

Returns

  • Promise < boolean >
    Required

    Promise of a boolean to indicate success or not.

apply

qlik.theme.get('my-theme-id').then(function(qtheme){
  qtheme.apply().then(function(result){
    console.log('theme applied with result: ' + result);
  });
});

QTheme getStyle(basePath, path, attribute) function

Get the value of a style attribute in the theme by searching in the theme's JSON structure. The search starts at the specified base path and continues upwards until the value is found. If possible, it will get the attribute's value using the given path.

Parameters

  • basePath string
    Required

    Base path in the theme's json structure to start the search in (specified as a name path separated by dots).

  • path string
    Required

    Expected path for the attribute (specified as a name path separated by dots).

  • attribute string
    Required

    Name of the style attribute.

Returns

  • string
    Required

    The style value.

getStyle

qlik.theme.get('my-theme-id').then(function(qtheme){
  console.log('Object title font size: ' + qtheme.getStyle('object', 'title.main', 'fontSize'));
});

new QVariable(app, qapp) class

Creates an instance of the Variable API.

QVariable create() function

Create variable.

Returns

  • Promise
    Required

    Promise of a Variable model.

create

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.create('myvar').then(function(model){
  // do something with myvar
});

QVariable createSessionVariable(qProp) function

Create session variable, which is a temporary variable that is not persisted and needs to be recreated for each new session.

Introduced in Qlik Sense 2.1.

Parameters

  • qProp object
    Required

    Variable properties.

    Show qProp properties
    • qInfo object
      Required
      Show qInfo properties
      • qId string

        Variable ID.

    • qName string
      Required

      Variable name.

    • qComment string

      Comment regarding the variable.

    • qDefinition string

      Variable definition.

    • qNumberPresentation object

      Defines the format of the value.

    • qIncludeInBookmark boolean

      Include in bookmark flag.

Returns

  • Promise
    Required

    Promise of a Variable model.

createSessionVariable

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.createSessionVariable({qName : 'myvar', qDefinition: 'Month'}).then(function(model){
  // do something with myvar
});

QVariable get(qId) function

Get a variable by ID.

Introduced in Qlik Sense 2.1.

Parameters

  • qId string
    Required

    Variable ID.

Returns

  • Promise
    Required

    Promise of a Variable model.

get

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.get('yTgsRI').then(function(model){
  // do something with myvar
});

QVariable getByName(qName) function

Get a variable by name.

Introduced in Qlik Sense 2.1.

Parameters

  • qName string
    Required

    Variable name.

Returns

  • Promise
    Required

    A promise of a Variable model.

getByName

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.getByName('myvar').then(function(model){
  // do something with myvar
});

QVariable getContent(name, callback) function

Get variable content.

Parameters

  • name string
    Required

    Variable name.

  • Required

    Callback to receive the content.

    Show callback properties
    • getContentCallback() function
      Required
      Parameters
      • data object
        Required

        Content of the variable.

        Show data properties
        • qContent object
          Required

          Value of the variable.

          Show qContent properties
          • qString string
            Required

            Textual value of the variable.

          • qIsNum number
            Required

            Numeric value of the variable, if the value can be converted into a number.

      • qapp object
        Required

        The qlik.app object wrapping the app.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

getContent

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.getContent('myvar',function ( reply ) {
  console.log( JSON.stringify( reply ) );
});

QVariable setContent(name, content) function

Deprecated

Set variable content.

Parameters

  • name string
    Required

    Variable name.

  • content string
    Required

    Variable content.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

setContent

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.setContent('myvar','=(1+1)');

QVariable setNumValue(qName, qVal) function

Set variable numeric value.

Introduced in Qlik Sense 2.1.

Parameters

  • qName string
    Required

    Variable name.

  • qVal number
    Required

    Variable value.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

setNumValue

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.setNumValue('myvar',5);

QVariable setStringValue(qName, qVal) function

Set variable string value.

Introduced in Qlik Sense 2.1.

Parameters

  • qName string
    Required

    Variable name.

  • qVal string
    Required

    Variable value.

Returns

  • Promise
    Required

    A promise of a Qlik engine reply.

setStringValue

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.variable.setStringValue('myvar','=(1+1)');

new QVisualization(qapp, model) class

The Visualization API allows developers to get visualizations defined in an app and to create temporary visualizations on the fly.

Introduced in Qlik Sense 2.2.

Properties

  • Required

    Table object for this visualization. Only for visualizations built on a hypercube.

    Show table properties
    • rows Array< QRow >
      Required

      Data rows.

    • headers Array< QHeader >
      Required

      Header information.

    • totals Array< QMeasureCell >
      Required

      Total information for measures.

    • rowCount number
      Required

      Total number of rows for the qHyperCube, including rows not fetched from server.

    • colCount number
      Required

      Total number of columns for the qHyperCube.

    • exportData() function
      Required

      Export data of the underlying hyperCube in OOXML or CSV format.

      Note: The entire hyperCube will be exported, not just the current data-page. On Cloud this functionality will go through the Reports API, which limits the available options

      Parameters
      • options object
        Show options properties
        • format string

          Data format. Can be one of: OOXML (open XML, default), CSV_C (comma separated CSV), CSV_T (tab separated CSV)

        • filename string

          This parameter is optional and only used in desktop. Sets the name of the exported file when downloaded. Example: filename(guid).xlsx.

        • state string

          Can be: A: all values, P: possible values (default)

        • download boolean

          Automatically start download of file (with window.open), defaults to false.

      • callback function

        Callback function returning the link to the exported file.

    • getColByName() function
      Required

      Get column number for a given field name.

      Parameters
      • fld string
        Required

        Field name.

      Returns
      • number
        Required

        Column number, starting with zero. Undefined if no column with that name.

    • getMoreData() function
      Required

      Get more data for your qHyperCube.

QVisualization close() function

Close visualization.

Returns

  • Promise
    Required

QVisualization exportData(options) function

Export data of the underlying hyperCube in OOXML or CSV format. Note: The entire hyperCube will be exported, not just the current data-page.

Parameters

  • options object
    Required
    Show options properties
    • format string

      Data format. Can be one of "OOXML" (open XML, default), "CSV_C" (comma separated CSV) or "CSV_T" (tab separated CSV)

    • state string

      Can be either "A", for all values, or "P", for possible values. "P" is the default.

Returns

  • any
    Required

    Promise - A promise of the file location URL.

exportData

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
  vis.exportData({format:'CSV_T', state: 'A'}).then(function (link) {
    window.open(link);
  });
});

QVisualization exportImg(settings) function

Exports a QVisualization instance to an image.

Parameters

  • settings object
    Required

    Image export settings.

    Show settings properties
    • height number  |  string
      Required

      Output height in pixels.

    • width number  |  string
      Required

      Output width in pixels.

    • format string
      Required

      The image type the visualization should be exported to. Can be PNG or JPG. Default is PNG.

    • download boolean

      automatically start download of file. default: false

Returns

  • any
    Required

    Promise - A promise of a link to the exported file.

exportImg

var element = document.getElementById('QV01');
var settings = { imageType: 'png', height: element.offsetHeight, width: element.offsetWidth }

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
  vis.exportImg(settings).then(function (result) {
    console.log('Image download link: ', result);
  });
});

QVisualization exportPdf(settings) function

Exports a QVisualization instance to PDF.

Parameters

  • settings object
    Required

    PDF export settings.

    Show settings properties
    • documentSize string  |  ObjectMetricSize
      Required

      Size of the output PDF. Accepts a string with one of the following document formats: "A3", "A4", "A5", "A6", "A7", "Letter" or an object with custom size.

    • orientation string
      Required

      Can be "portrait" or "landscape" (ignored if documentSize is an object) default "landscape".

    • aspectRatio number
      Required

      Aspect ratio: 0 = as specified in objectSize, 2 = fit to page.

    • Required

      Exported object height and width in pixels. Required when aspectRatio is 0.

      Show objectSize properties
      • height number
        Required

        Object height in pixels.

      • width number
        Required

        Object width in pixels.

    • download boolean

      automatically start download of file. default: false

Returns

  • any
    Required

    Promise - A promise of a link to the exported file.

exportPdf

var settings = {
  documentSize: "a4",
  aspectRatio: 2,
  orientation: "landscape"
};
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
  vis.exportPdf(settings).then(function (result) {
    console.log('PDF download link: ', result);
  });
});

QVisualization resize() function

Inform the visualization it has been resized and should repaint.

QVisualization setOptions(options) function

Set visualization options.

Parameters

  • options object
    Required

    Options to set. Refer to visualization.create for documentation.

Returns

  • Promise
    Required

    A promise of the RPC call's response.

setOptions

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
  vis.setOptions({title:"Now improved"});
});

QVisualization show(element?, options?) function

Show visualization in HTML element.

Parameters

  • element HTMLElement  |  string

    HTML element or HTML element ID.

  • options object

    Options to set. Since Qlik Sense 3.0.

    Show options properties
    • noInteraction boolean

      true if you want to disable all interaction in the visualization.

    • noSelections boolean

      true if you want to disable selections in the visualization.

Returns

  • object
    Required

    Scope of the visualization.

show

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
  vis.show("QV01");
});

QVisualization toggleDataView() function

Toggles data view.

Creates a DataView object if it doesn't already exist and toggles data view.

Introduced in Qlik Sense June 2018.

Disclaimer: The element that is provided as a parameter to the QVisualization.show method must have CSS property position set to relative and must not have any padding. If these rules are not followed, the visualization object may not calculate its width and height correctly and you may not be able to scroll and navigate after toggling data view.

Proposed action: Wrap the element with another element. The wrapper can then be styled without any limitations.

toggleDataView

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
  vis.show("QV01");
  vis.toggleDataView().then(function(toggled){
    if(toggled){
      this.getElementsByClassName('qv-st')[0].focus();
    }
  }
});

getContentCallback(data, qapp) function

Parameters

  • data object
    Required

    Content of the variable.

    Show data properties
    • qContent object
      Required

      Value of the variable.

      Show qContent properties
      • qString string
        Required

        Textual value of the variable.

      • qIsNum number
        Required

        Numeric value of the variable, if the value can be converted into a number.

  • qapp object
    Required

    The qlik.app object wrapping the app.