createCube method

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

Name Type Description
qHyperCubeDef Object Hypercube definition.
callback Function

Optional.

Callback method. Parameter will contain a qHyperCube.

Returns

A promise of an object model.

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?

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

Thanks for helping us improve!