qHyperCubeDef
Most visualization that comes built-in with Qlik Sense are based on a hypercube definition (qHyperCubeDef) on root level. A hypercube can contain both dimensions and measures. If selections are applied to a hypercube, only the selected values are displayed.
You can have multiple hypercubes in your properties (initialProperties). This allows you to make advanced visualizations that combine several data sets. If you have multiple hypercubes, you need to place them at different paths in your property structure.
Examples
Example: Hypercube definition in Chart template
initialProperties: {
version: 1.0,
qHyperCubeDef: {
qDimensions: [],
qMeasures: [],
qInitialDataFetch: [{
qWidth: 2,
qHeight: 50
}]
}
},
Example: Multiple hypercubes definition
initialProperties : {
version : 1.0,
qHyperCubeDef : {
qDimensions : [],
qMeasures : [],
qInitialDataFetch : [{
qWidth : 10,
qHeight : 50
}]
},
second : {
qHyperCubeDef : {
qDimensions : [],
qMeasures : [],
qInitialDataFetch : [{
qWidth : 10,
qHeight : 50
}]
}
}
}
Example: Enabling numerical sorting
initialProperties : {
qHyperCubeDef : {
qDimensions : [{
qDef : {
qFieldDefs : ["Dim1"]
}
}
],
qMeasures : [{
qDef:{
qDef : "=Sum(Expression1)"}
}
],
qInterColumnSortOrder : [1,0],
qInitialDataFetch : [{
qWidth : 10,
qHeight : 50
}]
}
},
Properties
Engine API documentation for a complete description of the qHyperCubeDef properties.