Skip to main content Skip to complementary content

createCube method

app.createCube(qHyperCubeDef, callback)

Method used to define a hyper cube and register a callback to receive the data.

Since:
  • 1.0
Information noteThis method was introduced in Qlik Sense version 1.0.

Parameters

Name Type Description
qHyperCubeDef Object Cube definition.
callback Function

Optional.

Callback method. Parameter will contain a qHyperCube.

Returns

A promise of an object model.

Tip noteFor more information regarding a promise, see http://docs.angularjs.org/api/ng.$q.

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

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!