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.
External interface to qlik, for mashups and including qlik in foreign web pages.
Properties
- Required
navigation properties
- stringRequired
Used for analysis mode.
- stringRequired
Used for edit mode.
- functionRequired
Get current sheet ID.
Returns- Required
The result of the navigation
properties
- booleanRequired
true if the navigation was successful.
- string
The new sheet ID.
- string
The error code if an error occurred, for example, NOSUCHSHEET or NOCURRENTSHEET.
- string
The error message, for example, 'No current sheet'.
-
-
- functionRequired
Get current mode.
Returns- stringRequired
mode The current mode.
-
- functionRequired
Navigates to a given sheet in the current app. Note that the method will return before the actual navigation takes place.
Parameters- stringRequired
The ID of the sheet to navigate to.
Returns- Required
The result of the navigation operation.
-
- functionRequired
Navigates to a given story in the current app. Note that the method will return before the actual navigation takes place.
Parameters- stringRequired
The ID of the story to navigate to.
Returns- Required
The result of the navigation operation.
properties
- booleanRequired
true if the navigation was successful.
- string
The new story ID.
- string
The error code if an error occurred, for example, NOSUCHSTORY.
- string
The error message, for example, 'No such story'.
-
-
- functionRequired
Checks if a given mode is allowed.
Parameters- stringRequired
The mode to check availability of. Can be either {@link QNavigaton#EDIT} or {@link QNavigaton#ANALYSIS}.
Returns- booleanRequired
If the mode is allowed or not.
-
- functionRequired
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- Required
The result of the navigation operation.
-
- functionRequired
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- Required
The result of the navigation operation.
-
- functionRequired
Set current mode.
Parameters- stringRequired
The mode to change to. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.
Returns- Required
The result of the mode change.
properties
- booleanRequired
true if the operation was successful.
- string
The new mode. Can be either {@link QNavigation#EDIT} or {@link QNavigation#ANALYSIS}.
- string
The error code if an error occurred, for example, MODENOTALLOWED.
- string
The error message, for example, 'Mode not allowed'.
-
-
-
- theme QGlobalThemeRequired
theme properties
- apply() functionRequired
Apply a theme to all visualizations on the web page.
Parameters- id stringRequired
ID of theme to apply.
Returns- Promise < boolean >Required
Promise of a boolean to indicate success or not.
-
- get() functionRequired
Get theme as a QTheme object.
Parameters- id stringRequired
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");
}
Call Qlik repository.
Parameters
- path stringRequired
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));
});
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.
properties
- addAlternateState() functionRequired
Add an alternate state.
Introduced in Qlik Sense 1.1.
Parameters- qStateName stringRequired
Alternate state name.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- back() functionRequired
Back to prev selection.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- bookmark QBookmarkRequired
bookmark properties
- apply() functionRequired
Apply bookmark.
Parameters- id stringRequired
Bookmark ID.
Returns- PromiseRequired
A promise of a Qlik engine reply. Since Qlik Sense 1.2.
-
- create() functionRequired
Create bookmark based on current selection.
Parameters- title stringRequired
Bookmark title.
- description stringRequired
Bookmark description.
- sheetId string
Bookmark sheet ID. Since Qlik Sense 2.2.
Returns- PromiseRequired
A promise of a Qlik engine reply. Since Qlik Sense 1.2.
-
- remove() functionRequired
Remove bookmark.
Parameters- id stringRequired
Bookmark ID.
Returns- PromiseRequired
A promise of a Qlik engine reply. Since Qlik Sense 1.2.
-
-
- clearAll() functionRequired
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- PromiseRequired
A promise of a Qlik engine reply.
-
- close() functionRequired
Close an app.
Will also close the web socket and clear out client side data.
Introduced in Qlik Sense 1.1
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- createCube() functionRequired
Defines a Qlik Hypercube and registers a callback to receive the data.
Parameters- qHyperCubeDef objectRequired
Cube definition.
- callback function
Callback method. Parameter will contain a qHyperCube.
Returns- PromiseRequired
A promise of an object model.
-
- createGenericObject() functionRequired
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 objectRequired
Generic object definition.
- callback function
Callback method.
Returns- PromiseRequired
A promise of an object model.
-
- createList() functionRequired
Defines a Qlik list of field values and registers a callback to receive the data.
Parameters- qListObjectDef objectRequired
List definition.
- callback function
Callback method. Parameter will contain a qListObject.
Returns- PromiseRequired
A promise of an object model.
-
- createTable() functionRequired
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() functionRequired
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 stringRequired
Session object ID.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- doReload() functionRequired
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- PromiseRequired
A promise of a Qlik engine reply.
-
- doSave() functionRequired
Save the app.
Introduced in Qlik Sense 1.1.
Parameters- qFileName string
File name of the file to save.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- field() functionRequired
Get a field reference with methods to manipulate field.
Parameters- fld stringRequired
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.
properties
- clear() functionRequired
Clears a field selection.
Returns- PromiseRequired
A promise of an engine response.
-
- clearOther() functionRequired
Clears all field selections except this one.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- getData() functionRequired
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.
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- Required
The field object.
-
- getMoreData() functionRequired
Get more data for your field. Notification OnData will be triggered when complete.
Introduced in Qlik Sense 2.1
Returns- Required
The field object
-
- lock() functionRequired
Locks a field selection.
Returns- PromiseRequired
A promise of an engine response.
-
- OnData NotificationRequired
OnData notification
OnData properties
- bind() functionRequired
Observe a Notification by sending in an observer function.
Parameters- observer functionRequired
The observer function to handle the notification.
-
- unbind() functionRequired
Stop observing a notification.
Parameters- observer functionRequired
The observer function that now should ignore any future notifications.
-
-
- qStateCounts objectRequired
Object with number of values in different states. Only after getData() call.
Introduced in Qlik Sense 2.1.
- rowCount numberRequired
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() functionRequired
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- PromiseRequired
A promise of an engine response.
-
- selectAll() functionRequired
Select all values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectAlternative() functionRequired
Select alternative values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectExcluded() functionRequired
Select excluded values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectMatch() functionRequired
Select matching field values.
Parameters- match stringRequired
Match string.
- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectPossible() functionRequired
Select possible values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectValues() functionRequired
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- PromiseRequired
A promise of an engine response.
-
- toggleSelect() functionRequired
Toggle field selection.
Parameters- match stringRequired
Match string.
- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- unlock() functionRequired
Unlocks a field selection.
Returns- PromiseRequired
A promise of an engine response.
-
-
-
- forward() functionRequired
Forward
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- getAppLayout() functionRequired
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- PromiseRequired
A promise of a Qlik engine reply.
-
- getAppObjectList() function DeprecatedRequired
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() functionRequired
Get properties for a Qlik object including children properties.
Parameters- id stringRequired
Object ID.
Returns- PromiseRequired
A promise of an object model.
-
- getList() functionRequired
Get a list of internal Qlik objects and register a callback to receive the data.
Parameters- type stringRequired
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- PromiseRequired
A promise of an object model.
-
- getObject() functionRequired
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 stringRequired
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.
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- PromiseRequired
A promise of an object model.
-
- getObjectProperties() functionRequired
Get properties for a Qlik object.
Parameters- id stringRequired
Object ID.
Returns- PromiseRequired
A promise of an object model.
-
- getScript() functionRequired
Gets the data load script of this app.
Introduced in Qlik Sense 4.0
Returns- PromiseRequired
A promise of a qScript object with the load script values.
-
- getSnapshot() functionRequired
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 stringRequired
Snapshot ID.
Returns- PromiseRequired
A promise of an object model.
-
- lockAll() functionRequired
Lock all selections.
Parameters- state string
Alternate state name. Since Qlik Sense 2.1.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- off() functionRequired
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() functionRequired
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 stringRequired
Name of the event. Can be: error, warning, closed.
- callback functionRequired
Callback method.
-
- removeAlternateState() functionRequired
Remove an alternate state.
Introduced in Qlik Sense 1.1.
Parameters- qStateName stringRequired
Alternate state name
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- searchAssociations() function DeprecatedRequired
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 objectRequired
qPage properties
- qOffset numberRequired
Position from the top, starting from 0.
- qCount numberRequired
Number of search results to return.
- qMaxNbrFieldMatches numberRequired
Maximum number of matching values to return per search result.
-
- qOptions object
Search options.
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- PromiseRequired
A promise of a Qlik engine reply.
-
- searchResults() functionRequired
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 objectRequired
qPage properties
- qOffset numberRequired
Position from the top, starting from 0.
- qCount numberRequired
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.
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- PromiseRequired
A promise of a Qlik engine reply.
-
- searchSuggest() functionRequired
Returns search suggestions.
Introduced in Qlik Sense 1.1.
Parameters- qTerms Array< string >Required
Terms to search for.
- qOptions object
Search options.
qOptions properties
- qSearchFields Array< string >
List of search fields.
-
- callback function
Callback method.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- selectAssociations() functionRequired
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.
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- PromiseRequired
A promise of a Qlik engine reply.
-
- selectionState() functionRequired
Creates a SelectionState object that encapsulates the selection state.
Introduced in Qlik Sense 2.2.
Parameters- state string
Sets the state.
Returns- Required
A selection state object for the selection state of type QSelectionState.
properties
- stateName stringRequired
State name, '$' for default state.
- selections Array< QFieldSelections >Required
Selections
- backCount numberRequired
Number of back steps available.
- forwardCount numberRequired
Number of forward steps available.
- OnData NotificationRequired
OnData notification.
- clearAll() functionRequired
Clear all selections in this state.
Parameters- lockedAlso boolean
Clear locked fields also.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- lockAll() functionRequired
Lock all selections in this state.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- unlockAll() functionRequired
Unlock all selections in this state.
Returns- PromiseRequired
A promise of a Qlik engine reply
-
-
-
- setScript() functionRequired
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 stringRequired
The script content.
Returns- PromiseRequired
A promise of an empty object or a list of syntax errors depending on the validation result.
-
- theme QAppThemeRequired
theme properties
- get() functionRequired
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() functionRequired
Get currently applied theme as a QTheme object.
Returns- Promise < QTheme >Required
A promise of a QTheme object.
-
- save() functionRequired
Save a theme ID of an app.
Introduced in Qlik Sense February 2018.
Parameters- id stringRequired
Theme ID.
-
-
- unlockAll() functionRequired
Unlock all selections.
Parameters- state string
Alternate state name. Since Qlik Sense 2.1.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- variable QVariableRequired
variable properties
- create() functionRequired
Create variable.
Returns- PromiseRequired
Promise of a Variable model.
-
- createSessionVariable() functionRequired
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 objectRequired
Variable properties.
qProp properties
- qInfo objectRequired
qInfo properties
- qId string
Variable ID.
-
- qName stringRequired
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- PromiseRequired
Promise of a Variable model.
-
- get() functionRequired
Get a variable by ID.
Introduced in Qlik Sense 2.1.
Parameters- qId stringRequired
Variable ID.
Returns- PromiseRequired
Promise of a Variable model.
-
- getByName() functionRequired
Get a variable by name.
Introduced in Qlik Sense 2.1.
Parameters- qName stringRequired
Variable name.
Returns- PromiseRequired
A promise of a Variable model.
-
- getContent() functionRequired
Get variable content.
Parameters- name stringRequired
Variable name.
- callback getContentCallbackRequired
Callback to receive the content.
callback properties
- getContentCallback() functionRequiredParameters
- data objectRequired
Content of the variable.
data properties
- qContent objectRequired
Value of the variable.
qContent properties
- qString stringRequired
Textual value of the variable.
- qIsNum numberRequired
Numeric value of the variable, if the value can be converted into a number.
-
-
- qapp objectRequired
The qlik.app object wrapping the app.
-
-
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- setContent() function DeprecatedRequired
Set variable content.
Parameters- name stringRequired
Variable name.
- content stringRequired
Variable content.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- setNumValue() functionRequired
Set variable numeric value.
Introduced in Qlik Sense 2.1.
Parameters- qName stringRequired
Variable name.
- qVal numberRequired
Variable value.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- setStringValue() functionRequired
Set variable string value.
Introduced in Qlik Sense 2.1.
Parameters- qName stringRequired
Variable name.
- qVal stringRequired
Variable value.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
-
- visualization QAppVisualizationRequired
visualization properties
- create() functionRequired
Create a new visualization. The visualization will be based on a session object and not persisted in the app.
Parameters- type stringRequired
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.
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- Promise < QVisualization >Required
A promise of a {@link QVisualization}.
-
- get() functionRequired
Get an existing visualization.
Introduced in Qlik Sense 2.2.
Parameters- id stringRequired
ID for an existing visualization.
Returns- Promise < QVisualization >Required
A promise of a {@link QVisualization}.
-
-
-
currApp
var app = qlik.currApp(this);
app.clearAll();
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 functionRequired
Callback method.
- config object
Additional configuration parameters.
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);
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
- PromiseRequired
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);
});
Open a connection with a Web Socket to engine for global methods.
Parameters
- config object
Additional configuration parameters.
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.
properties
- cancelReload() functionRequired
Cancel reload.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- getAppList() functionRequired
Get app list.
Parameters- callback functionRequired
callback method.
-
- getAuthenticatedUser() functionRequired
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- PromiseRequired
A promise of a Qlik engine reply.
-
- getProductVersion() function DeprecatedRequired
Get Product Version.
Introduced in Qlik Sense 1.2.
Parameters- callback function
callback method.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- getProgress() functionRequired
Get Progress.
Introduced in Qlik Sense 2.1.
Parameters- qRequestId numberRequired
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- PromiseRequired
A promise of a Qlik engine reply.
-
- getQTProduct() functionRequired
Get QT Product.
Parameters- callback function
callback method.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- isPersonalMode() functionRequired
Get isPersonalMode.
Parameters- callback function
callback method.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- off() functionRequired
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() functionRequired
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 stringRequired
Name of the event. Can be: error, warning, closed.
- callback functionRequired
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);
});
Get a list of themes from the system. The list will contain both default and custom themes.
Returns
- PromiseRequired
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);
});
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");
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 stringRequired
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 functionRequired
Callback method.
on
qlik.on("error", err=>{
console.error(err);
});
qlik.on("warning", warn=>{
console.warn(warn);
});
Opens the app. You can open multiple apps. Most other methods are defined on the app. Introduced in Qlik Sense 1.0.
Parameters
- appId stringRequired
The app ID.
- config object
Additional configuration parameters.
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);
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 functionRequired
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);
});
}
});
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 stringRequired
Set the ID of the visualization extension.
- impl objectRequired
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 );
});
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();
});
Creates a session/cached QApp object.
Parameters
- config object
Additional configuration parameters.
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);
Creates a session/cached QApp object from an existing app.
Parameters
- appId stringRequired
App ID of the app to base the session app upon.
- config object
Additional configuration parameters.
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");
Sets device type, which modifies the UI accordingly. The device type is automatically detected if it is not manually set.
Parameters
- deviceType stringRequired
Type of device. One of: auto, touch, desktop.
setDeviceType
qlik.setDeviceType('desktop');
setLanguage
qlik.setLanguage("es");
Parameters
- onError functionRequired
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);
});
Create a QTable object that wraps data in your extension and provides an object-oriented interface.
Parameters
- ext objectRequired
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.
properties
- rows Array< QRow >Required
Data rows.
- headers Array< QHeader >Required
Header information.
- totals Array< QMeasureCell >Required
Total information for measures.
- rowCount numberRequired
Total number of rows for the qHyperCube, including rows not fetched from server.
- colCount numberRequired
Total number of columns for the qHyperCube.
- exportData() functionRequired
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
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() functionRequired
Get column number for a given field name.
Parameters- fld stringRequired
Field name.
Returns- numberRequired
Column number, starting with zero. Undefined if no column with that name.
-
- getMoreData() functionRequired
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>
Observe a Notification by sending in an observer function.
Parameters
- observer functionRequired
The observer function to handle the notification.
Stop observing a notification.
Parameters
- observer functionRequired
The observer function that now should ignore any future notifications.
Describes the size, in millimeters (mm), of a 2D object.
Properties
- height numberRequired
Object height in millimeters (mm).
- width numberRequired
Object width in millimeters (mm).
Describes the size, in pixels, of a 2D object.
Properties
- height numberRequired
Object height in pixels.
- width numberRequired
Object width in pixels.
Properties
- bookmark QBookmarkRequired
bookmark properties
- apply() functionRequired
Apply bookmark.
Parameters- id stringRequired
Bookmark ID.
Returns- PromiseRequired
A promise of a Qlik engine reply. Since Qlik Sense 1.2.
-
- create() functionRequired
Create bookmark based on current selection.
Parameters- title stringRequired
Bookmark title.
- description stringRequired
Bookmark description.
- sheetId string
Bookmark sheet ID. Since Qlik Sense 2.2.
Returns- PromiseRequired
A promise of a Qlik engine reply. Since Qlik Sense 1.2.
-
- remove() functionRequired
Remove bookmark.
Parameters- id stringRequired
Bookmark ID.
Returns- PromiseRequired
A promise of a Qlik engine reply. Since Qlik Sense 1.2.
-
-
- theme QAppThemeRequired
theme properties
- get() functionRequired
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() functionRequired
Get currently applied theme as a QTheme object.
Returns- Promise < QTheme >Required
A promise of a QTheme object.
-
- save() functionRequired
Save a theme ID of an app.
Introduced in Qlik Sense February 2018.
Parameters- id stringRequired
Theme ID.
-
-
- variable QVariableRequired
variable properties
- create() functionRequired
Create variable.
Returns- PromiseRequired
Promise of a Variable model.
-
- createSessionVariable() functionRequired
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 objectRequired
Variable properties.
qProp properties
- qInfo objectRequired
qInfo properties
- qId string
Variable ID.
-
- qName stringRequired
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- PromiseRequired
Promise of a Variable model.
-
- get() functionRequired
Get a variable by ID.
Introduced in Qlik Sense 2.1.
Parameters- qId stringRequired
Variable ID.
Returns- PromiseRequired
Promise of a Variable model.
-
- getByName() functionRequired
Get a variable by name.
Introduced in Qlik Sense 2.1.
Parameters- qName stringRequired
Variable name.
Returns- PromiseRequired
A promise of a Variable model.
-
- getContent() functionRequired
Get variable content.
Parameters- name stringRequired
Variable name.
- callback getContentCallbackRequired
Callback to receive the content.
callback properties
- getContentCallback() functionRequiredParameters
- data objectRequired
Content of the variable.
data properties
- qContent objectRequired
Value of the variable.
qContent properties
- qString stringRequired
Textual value of the variable.
- qIsNum numberRequired
Numeric value of the variable, if the value can be converted into a number.
-
-
- qapp objectRequired
The qlik.app object wrapping the app.
-
-
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- setContent() function DeprecatedRequired
Set variable content.
Parameters- name stringRequired
Variable name.
- content stringRequired
Variable content.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- setNumValue() functionRequired
Set variable numeric value.
Introduced in Qlik Sense 2.1.
Parameters- qName stringRequired
Variable name.
- qVal numberRequired
Variable value.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- setStringValue() functionRequired
Set variable string value.
Introduced in Qlik Sense 2.1.
Parameters- qName stringRequired
Variable name.
- qVal stringRequired
Variable value.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
-
- visualization QAppVisualizationRequired
visualization properties
- create() functionRequired
Create a new visualization. The visualization will be based on a session object and not persisted in the app.
Parameters- type stringRequired
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.
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- Promise < QVisualization >Required
A promise of a {@link QVisualization}.
-
- get() functionRequired
Get an existing visualization.
Introduced in Qlik Sense 2.2.
Parameters- id stringRequired
ID for an existing visualization.
Returns- Promise < QVisualization >Required
A promise of a {@link QVisualization}.
-
-
Add an alternate state.
Introduced in Qlik Sense 1.1.
Parameters
- qStateName stringRequired
Alternate state name.
Returns
- PromiseRequired
A promise of a Qlik engine reply.
addAlternateState
app.addAlternateState("X");
Back to prev selection.
Returns
- PromiseRequired
A promise of a Qlik engine reply.
back
var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.back();
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
- PromiseRequired
A promise of a Qlik engine reply.
clearAll
var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.clearAll();
Close an app.
Will also close the web socket and clear out client side data.
Introduced in Qlik Sense 1.1
Returns
- PromiseRequired
A promise of a Qlik engine reply.
close
var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.close();
Defines a Qlik Hypercube and registers a callback to receive the data.
Parameters
- qHyperCubeDef objectRequired
Cube definition.
- callback function
Callback method. Parameter will contain a qHyperCube.
Returns
- PromiseRequired
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);
});
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 objectRequired
Generic object definition.
- callback function
Callback method.
Returns
- PromiseRequired
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);
});
Defines a Qlik list of field values and registers a callback to receive the data.
Parameters
- qListObjectDef objectRequired
List definition.
- callback function
Callback method. Parameter will contain a qListObject.
Returns
- PromiseRequired
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);
});
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.
properties
- rows Array< QRow >Required
Data rows.
- headers Array< QHeader >Required
Header information.
- totals Array< QMeasureCell >Required
Total information for measures.
- rowCount numberRequired
Total number of rows for the qHyperCube, including rows not fetched from server.
- colCount numberRequired
Total number of columns for the qHyperCube.
- exportData() functionRequired
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
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() functionRequired
Get column number for a given field name.
Parameters- fld stringRequired
Field name.
Returns- numberRequired
Column number, starting with zero. Undefined if no column with that name.
-
- getMoreData() functionRequired
Get more data for your qHyperCube.
-
createTable
var users = app.createTable(["FirstName", "LastName"], ["Count(Case Id)"],{rows:200});
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 stringRequired
Session object ID.
Returns
- PromiseRequired
A promise of a Qlik engine reply.
destroySessionObject
app.destroySessionObject( 'xcVtY');
app.destroySessionObject(reply.qInfo.qId);
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
- PromiseRequired
A promise of a Qlik engine reply.
doReload
app.doReload();
Save the app.
Introduced in Qlik Sense 1.1.
Parameters
- qFileName string
File name of the file to save.
Returns
- PromiseRequired
A promise of a Qlik engine reply.
doSave
app.doReload().then(function(){
app.doSave();
});
Get a field reference with methods to manipulate field.
Parameters
- fld stringRequired
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.
properties
- clear() functionRequired
Clears a field selection.
Returns- PromiseRequired
A promise of an engine response.
-
- clearOther() functionRequired
Clears all field selections except this one.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- getData() functionRequired
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.
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- Required
The field object.
-
- getMoreData() functionRequired
Get more data for your field. Notification OnData will be triggered when complete.
Introduced in Qlik Sense 2.1
Returns- Required
The field object
-
- lock() functionRequired
Locks a field selection.
Returns- PromiseRequired
A promise of an engine response.
-
- OnData NotificationRequired
OnData notification
OnData properties
- bind() functionRequired
Observe a Notification by sending in an observer function.
Parameters- observer functionRequired
The observer function to handle the notification.
-
- unbind() functionRequired
Stop observing a notification.
Parameters- observer functionRequired
The observer function that now should ignore any future notifications.
-
-
- qStateCounts objectRequired
Object with number of values in different states. Only after getData() call.
Introduced in Qlik Sense 2.1.
- rowCount numberRequired
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() functionRequired
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- PromiseRequired
A promise of an engine response.
-
- selectAll() functionRequired
Select all values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectAlternative() functionRequired
Select alternative values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectExcluded() functionRequired
Select excluded values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectMatch() functionRequired
Select matching field values.
Parameters- match stringRequired
Match string.
- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectPossible() functionRequired
Select possible values in field.
Parameters- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- selectValues() functionRequired
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- PromiseRequired
A promise of an engine response.
-
- toggleSelect() functionRequired
Toggle field selection.
Parameters- match stringRequired
Match string.
- softlock boolean
If true, locked selections can be overridden.
Returns- PromiseRequired
A promise of an engine response.
-
- unlock() functionRequired
Unlocks a field selection.
Returns- PromiseRequired
A promise of an engine response.
-
-
forward
var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.forward();
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
- PromiseRequired
A promise of a Qlik engine reply.
getAppLayout
app.getAppLayout(function(layout){
console.log(layout.qTitle);
});
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);
});
Get properties for a Qlik object including children properties.
Parameters
- id stringRequired
Object ID.
Returns
- PromiseRequired
A promise of an object model.
getFullPropertyTree
app.getFullPropertyTree(value.qInfo.qId).then(function(model){
console.log(model.propertyTree.qChildren.length + ' children');
});
Get a list of internal Qlik objects and register a callback to receive the data.
Parameters
- type stringRequired
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
- PromiseRequired
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);
});
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 stringRequired
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.
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
- PromiseRequired
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);
}});
Get properties for a Qlik object.
Parameters
- id stringRequired
Object ID.
Returns
- PromiseRequired
A promise of an object model.
getObjectProperties
app.getObjectProperties("uPyZavD").then(function(model){
this.title = model.properties.title;
});
Gets the data load script of this app.
Introduced in Qlik Sense 4.0
Returns
- PromiseRequired
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);
});
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 stringRequired
Snapshot ID.
Returns
- PromiseRequired
A promise of an object model.
getSnapshot
app.getSnapshot(document.getElementById("SNAPSHOT"), "uPyZavD");
Lock all selections.
Parameters
- state string
Alternate state name. Since Qlik Sense 2.1.
Returns
- PromiseRequired
A promise of a Qlik engine reply.
lockAll
var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.lockAll();
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");
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 stringRequired
Name of the event. Can be: error, warning, closed.
- callback functionRequired
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);
});
Remove an alternate state.
Introduced in Qlik Sense 1.1.
Parameters
- qStateName stringRequired
Alternate state name
Returns
- PromiseRequired
A promise of a Qlik engine reply.
removeAlternateState
app.removeAlternateState("X");
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 objectRequired
qPage properties
- qOffset numberRequired
Position from the top, starting from 0.
- qCount numberRequired
Number of search results to return.
- qMaxNbrFieldMatches numberRequired
Maximum number of matching values to return per search result.
-
- qOptions object
Search options.
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
- PromiseRequired
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);
});
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 objectRequired
qPage properties
- qOffset numberRequired
Position from the top, starting from 0.
- qCount numberRequired
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.
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
- PromiseRequired
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);
}
});
Returns search suggestions.
Introduced in Qlik Sense 1.1.
Parameters
- qTerms Array< string >Required
Terms to search for.
- qOptions object
Search options.
qOptions properties
- qSearchFields Array< string >
List of search fields.
-
- callback function
Callback method.
Returns
- PromiseRequired
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);
});
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.
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
- PromiseRequired
A promise of a Qlik engine reply.
selectAssociations
app.selectAssociations( 0, ["May","Mar"] );
Creates a SelectionState object that encapsulates the selection state.
Introduced in Qlik Sense 2.2.
Parameters
- state string
Sets the state.
Returns
- Required
A selection state object for the selection state of type QSelectionState.
properties
- stateName stringRequired
State name, '$' for default state.
- selections Array< QFieldSelections >Required
Selections
- backCount numberRequired
Number of back steps available.
- forwardCount numberRequired
Number of forward steps available.
- OnData NotificationRequired
OnData notification.
- clearAll() functionRequired
Clear all selections in this state.
Parameters- lockedAlso boolean
Clear locked fields also.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- lockAll() functionRequired
Lock all selections in this state.
Returns- PromiseRequired
A promise of a Qlik engine reply.
-
- unlockAll() functionRequired
Unlock all selections in this state.
Returns- PromiseRequired
A promise of a Qlik engine reply
-
-
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 stringRequired
The script content.
Returns
- PromiseRequired
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);
});
Unlock all selections.
Parameters
- state string
Alternate state name. Since Qlik Sense 2.1.
Returns
- PromiseRequired
A promise of a Qlik engine reply.
unlockAll
var app = qlik.openApp('2abac31e-3b46-4b78-8bxf-c5cea1d2514d');
app.unlockAll();
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);
});
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);
});
Save a theme ID of an app.
Introduced in Qlik Sense February 2018.
Parameters
- id stringRequired
Theme ID.
save
app.theme.save('my-theme-id');
Create a new visualization. The visualization will be based on a session object and not persisted in the app.
Parameters
- type stringRequired
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.
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
- Promise < QVisualization >Required
A promise of a {@link QVisualization}.
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");
});
Get an existing visualization.
Introduced in Qlik Sense 2.2.
Parameters
- id stringRequired
ID for an existing visualization.
Returns
- Promise < QVisualization >Required
A promise of a {@link QVisualization}.
get
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.visualization.get('xGhjKl').then(function(vis){
vis.show("QV01");
});
Apply bookmark.
Parameters
- id stringRequired
Bookmark ID.
Returns
- PromiseRequired
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");
Create bookmark based on current selection.
Parameters
- title stringRequired
Bookmark title.
- description stringRequired
Bookmark description.
- sheetId string
Bookmark sheet ID. Since Qlik Sense 2.2.
Returns
- PromiseRequired
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");
Remove bookmark.
Parameters
- id stringRequired
Bookmark ID.
Returns
- PromiseRequired
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");
Wrapper around a HyperCube dimension cell.
Properties
- qText stringRequired
Cell value formatted as set up in properties.
- qElemNumber numberRequired
Cell value index.
- qState stringRequired
Cell state.
- qNum number
Cell numeric value, if cell is numeric.
select
<div class="selectable" ng-class="{'selected':cell.selected}" ng-click="cell.select($event)">{{cell.qText}}</div>
External interface to the fields in a Qlik Sense app and contains methods for field level commands.
Properties
- OnData NotificationRequired
OnData notification
OnData properties
- bind() functionRequired
Observe a Notification by sending in an observer function.
Parameters- observer functionRequired
The observer function to handle the notification.
-
- unbind() functionRequired
Stop observing a notification.
Parameters- observer functionRequired
The observer function that now should ignore any future notifications.
-
-
- qStateCounts objectRequired
Object with number of values in different states. Only after getData() call.
Introduced in Qlik Sense 2.1.
- rowCount numberRequired
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.
Clears a field selection.
Returns
- PromiseRequired
A promise of an engine response.
clear
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').clear();
Clears all field selections except this one.
Parameters
- softlock boolean
If true, locked selections can be overridden.
Returns
- PromiseRequired
A promise of an engine response.
clearOther
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
app.field('LastName').clearOther(true);
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.
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
- Required
The field object.
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>
Get more data for your field. Notification OnData will be triggered when complete.
Introduced in Qlik Sense 2.1
Returns
- Required
The field object
getMoreData
<button ng-if="fieldMonth.rowCount>fieldMonth.rows.length" ng-click="fieldMonth.getMoreData()">More</button>