Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I develop an extension qlik sense and I'm stuck in a point.
I want to get all data from a table, so i use an ID ( v.selectedtableObject ) to get the object:
qlik.currApp.getObject(v.selectedTableObject).then(function(model){Then i get the title of dimension and measure:
//Dim
model.layout.qHyperCube.qDimensionInfo.forEach( function(value, col) {//Dim
tableHTML += value.qFallbackTitle;
});
//Mea
model.layout.qHyperCube.qMeasureInfo.forEach( function(value, col) {//Mea
tableHTML += value.qFallbackTitle ;
});Then i get the total value:
//Total
model.layout.qHyperCube.qGrandTotalRow.forEach( function(value, col) {//total
tableHTML += value.qText ;
});And now i want to get the data (dimension and measure) values, normally it's here:
model.layout.qHyperCube.qDataPages[0].qMatrix
but qDataPages is empty...
Maybe the data was not here...
Some one can help me ? ![]()
Ok i finded a solution, for get the data i need to call this function (getHyperCubeData).
Here i get 8 column and 100 line. (but we can get the 10,000 values of the hypercube).
So i call the getHyperCubeData function, then I initialize the dataPage,
-> then I go in the 1st dimension of my data variable (it's the dataPage),
-> then i browse the 1st dimension of the qMatrix array (it's the line),
-> then i browse the 2nd dimension of the qMatrix array (it's the column),
-> and then I add to my variable the value of the cell (row.qText)
model.getHyperCubeData('/qHyperCubeDef', [{
qLeft: 0,
qTop: 0,
qWidth: 8,
qHeight: 100
}]).then( function ( data ) {
//Dim
data[0].qMatrix.forEach( function(rows) {//1D
rows.forEach( function(row) {//2D
tableHTML += row.qText;
});//End of 2D
});//End of 1D
});//End of getHyperCubeData
Ok i finded a solution, for get the data i need to call this function (getHyperCubeData).
Here i get 8 column and 100 line. (but we can get the 10,000 values of the hypercube).
So i call the getHyperCubeData function, then I initialize the dataPage,
-> then I go in the 1st dimension of my data variable (it's the dataPage),
-> then i browse the 1st dimension of the qMatrix array (it's the line),
-> then i browse the 2nd dimension of the qMatrix array (it's the column),
-> and then I add to my variable the value of the cell (row.qText)
model.getHyperCubeData('/qHyperCubeDef', [{
qLeft: 0,
qTop: 0,
qWidth: 8,
qHeight: 100
}]).then( function ( data ) {
//Dim
data[0].qMatrix.forEach( function(rows) {//1D
rows.forEach( function(row) {//2D
tableHTML += row.qText;
});//End of 2D
});//End of 1D
});//End of getHyperCubeData