createCube method

Note: STABLE.
This API is reliable and breaking changes are unlikely.

qlik.app.createCube(qHyperCubeDef, callback)

Defines a hypercube and registers a callback to receive the data.

Version history

Introduced 1.0

Parameters

qHyperCubeDef

Type: Object

Hypercube definition.

callback

Type: Function

Optional.

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

Parameter will contain a qHyperCube.

Returns

A promise of an object model.

Tip: For more information regarding a promise, see https://code.angularjs.org/1.7.0/docs/api/ng/service/$q#the-promise-api.

Example

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);
	;
});

See also:

 

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?