create method

This API is reliable and breaking changes are unlikely.

Creates a variable.

Note: A new implementation of the create method was introduced in version 2.1. The legacy implementation of the method will continue to work but it is recommended to use the new implementation.

Version history

Introduced 1.0
Updated 2.1


Name Type Description
qProp String | Object

Variable name or properties. Properties:

Name Type Description
qInfo.qId String


Variable id.

If the selected ID is already in use, a new ID is automatically set by the engine.

qName String

Variable name.

The name must be unique.

qComment String


Comment related to the variable.

qDefinition String


Variable definition.

qNumberPresentation Object


Defines the format of the value.

qIncludeInBookmark Boolean


Set to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark.


Returns a promise of a variable model.

Tip: For more information regarding a promise, see$q#the-promise-api.


Example: Current implementation - object

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d');
	app.variable.create({qName : 'myvar', qDefinition: 'Month'});
Name Type Description
Name String

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?