Skip to content

Instantly share code, notes, and snippets.

Erik Wetterberg erikwett

View GitHub Profile
View propertypanelrowcount.js
addons: {
uses: "addons",
items: {
dataHandling: {
uses: "dataHandling",
items: {
rowCount: {
ref:'qHyperCubeDef.qInitialDataFetch.0.qHeight',
type:'integer',
label: 'Row count',
@erikwett
erikwett / initialProperties.js
Created Oct 5, 2018
Qlik Sense initialProperties with initialDataFetch
View initialProperties.js
initialProperties: {
qHyperCubeDef: {
qDimensions: [],
qMeasures: [],
qInitialDataFetch: [{
qWidth: 20,
qHeight: 500
}]
}
}
@erikwett
erikwett / start_task.js
Created Aug 22, 2018
Start Qlik Sense task
View start_task.js
function startReload(taskid) {
return qlik.callRepository('/qrs/task/' + taskid + '/start', 'POST').then(function(reply) {
console.log('start task', reply);
});
}
@erikwett
erikwett / create_task.js
Last active Aug 22, 2018
Create Qlik Sense reload task from javascript
View create_task.js
function createTask(appid, appname){
qlik.callRepository('/qrs/ReloadTask', 'POST', {
app: {
id: appid
},
enabled: true,
name: "Reload " + appname,
maxRetries: 5
}).then(function(reply){
console.log('Task created',reply);
@erikwett
erikwett / property_panell_add_to_measure.js
Created Jul 17, 2018
Add your own property to the built-in measure property
View property_panell_add_to_measure.js
measures: {
uses: "measures",
min: 1,
max: 6,
items: {
type: {
ref: "qDef.type",
type: "string",
label: "Type",
component: "dropdown",
@erikwett
erikwett / property_panel_dropdown_custom.js
Last active Jul 17, 2018
Qlik Sense extension: property panel dropdown with custom alternative
View property_panel_dropdown_custom.js
width: {
type: 'string',
component: 'dropdown',
label: 'Width',
ref: 'width',
options: [{value: '', label: 'Default'},
{value: 'fill', label: 'Fill'},
{value: 'custom', label: 'Custom'}]
},
customwidth: {
@erikwett
erikwett / gist:256e52ece04dfce2dbbacf543d85c029
Last active Jul 17, 2018
property_panel_expression_always.js
View gist:256e52ece04dfce2dbbacf543d85c029
width: {
type: 'string',
ref: 'width',
label: 'Width',
expression: 'optional'
}
@erikwett
erikwett / create_alt_state.js
Last active Apr 26, 2018
Property panel code to add an alternate state
View create_alt_state.js
addstate: {
ref: "statename",
label: "Add state",
type: "string",
change: function (data) {
if(data.statename){
qlik.currApp().addAlternateState(data.statename);
}
}
}
@erikwett
erikwett / add_alt_state_dropdown.js
Last active Apr 26, 2018
Alternate state field as a dropdown
View add_alt_state_dropdown.js
state: {
ref: "qHyperCubeDef.qStateName",
label: "State",
type: "string",
defaultValue: "$",
component: "dropdown",
options: function () {
return qlik.currApp(this).getAppLayout().then(function (a) {
return a.layout.qStateNames.concat('$').map(function (state) {
return {
@erikwett
erikwett / add_alt_state.js
Last active Apr 26, 2018
Add alternate state to Qlik Sense property panel
View add_alt_state.js
addons: {
uses: "addons",
items: {
advanced: {
label: "Advanced",
type: "items",
items: {
state: {
ref: "qHyperCubeDef.qStateName",
label: "State",
You can’t perform that action at this time.