Skip to content

Instantly share code, notes, and snippets.

var qsocks = require('qsocks')
// Connecting to Qlik Sense Desktop
var connect = qsocks.Connect()
connect
.then(function(global) {
// from the global handle we can invoke methods from the global class
return global.openDoc('Executive Dashboard.qvf')
})
var qsocks = require('qsocks')
var serializeApp = require('serializeapp')
var fs = require('fs-extra')
var Promise = require('promise')
function create(docname) {
qsocks.Connect({appname: docname})
.then(function(global) {
return global.openDoc(docname)
})
This file has been truncated, but you can view the full file.
{
"properties": {
"qTitle": "Telecom Customer Retention",
"qLastReloadTime": "2015-09-10T08:37:00.000-0400",
"qMigrationHash": "b292f16feef290afff43a1b5f937f45f03c1b830",
"qSavedInProductVersion": "2.1.0",
"qThumbnail": {},
"description": "The Telecom Customer Retention application is based on data from the wireless phone industry. The application shows how a company within the wireless industry tracks customers for churn and revenue.",
"qFileSize": 10485691,
"dynamicColor": ""
@mindspank
mindspank / qsocks.node.connectlocal.js
Last active September 20, 2015 17:01
qsocks - sample
//Require the module
var qsocks = require('qsocks');
//For Qlik Sense Desktop
//You have two different entry points, the global handle or connect directly to an app.
//The entire Engine API is async and managed through promises in this module.
//Global
//Connecting to the Engine, once connected returns the handle for global.
@mindspank
mindspank / AlternateStates.js
Last active September 26, 2015 15:13
Set listbox in alternate state
/**
* Add a new alternate states to a app.
* Change a listbox to use this new alternate state.
*/
var qsocks = require('qsocks')
qsocks.Connect({appname: 'Sales Discovery.qvf'})
.then(function(global) {
return global.openDoc('Sales Discovery.qvf')
@mindspank
mindspank / QRS-Listapps.js
Created July 2, 2015 20:26
QRS-Listapps.js
/**
* Connects to the QRS API (REST based) using certificates.
* See this article for more information about connecting to QRS https://help.qlik.com/sense/2.0/en-us/developer/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Connect-API.htm
*
*/
var https = require('https');
var fs = require('fs');
@mindspank
mindspank / grid.js
Created October 26, 2015 20:45
Grid change
app.getObject( "THE SHEET ID" ).then(function(obj) {
// Patch some properties on the sheet.
// In this case replace the column and row properties with new values
obj.applyPatches([{
qPath: '/columns',
qOp: 'replace',
qValue: '200'
},{
qPath: '/rows',
qOp: 'replace',
@mindspank
mindspank / index.html
Created May 7, 2015 21:10
Leverage qsocks from within a mashup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://sense-demo.qlik.com/resources/autogenerated/qlikui.css">
@mindspank
mindspank / list.js
Created November 6, 2015 14:21
Listbox always sorted numerical
define(['jquery'], function($) {
return {
initialProperties: {
qListObjectDef: {
qDef: {
qFieldDefs: [
'[Fiscal Year]'
],
qSortCriterias: [{
qSortByNumeric: -1,
@mindspank
mindspank / refresh.ps1
Last active November 22, 2015 20:07
A short powershell script that will refresh cached Qlik Sense charts using chartcacher https://github.com/mindspank/chartcacher
$qlikserver = "https://<qliksensehostname>:1337/"
$nocache = '/nocache'
$urls = $("24cc3e5a-622b-4267-97e0-38851090f5a7/JEBdZz", "24cc3e5a-622b-4267-97e0-38851090f5a7/ARNmpdM", "24cc3e5a-622b-4267-97e0-38851090f5a7/BmfQbz")
foreach($url in $urls) {
Invoke-RestMethod "$qlikserver$url$nocache"
}