Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I tried with this funtion
var table = qlik.table(model);
var colNumber = table.getColByName('cedant_parent_name');
var rowCount = table.rowCount;
var cellvalue= table.row[0].dimensions[0].qText;
You either need to use a listener to be able to fetch the row counts:
var table = qlik.table( this );
var listener = function() {
var rowCount = table.rowCount;
var colCount = table.colCount;
table.OnData.unbind( listener ); //unregister the listener when no longer notification is needed.
};
table.OnData.bind( listener ); //bind the listener
Or you can do it like this:
var rows = table.qHyperCube.qSize.qcy;
var cols = table.qHyperCube.qSize.qcx;
Regarding dimension value, that's depending on how many dimensions you have added and on which row you want to fetch the value.
This is an example on how to loop through all your data:
var data = table.qHyperCube.qDataPages[0].qMatrix;
$.each(data, function( key, value ) {
console.log("value", value);
});
Thank you for the reply i can able to get the row count using
var rowCount = table.rowCount;
but i want the particular dimension column values or the binded html to bind the my custom functions;
I dont know how the listener help to get the data?
If you look at my example where I loop through the data.
The variable "value" will contain all the different dimension & measure values for the current row, or is this not what you are after?
Hi jesper,
When i tried to add the below variable from table is affecting my js
var data = table.qHyperCube.qDataPages[0].qMatrix;
Hi,
Have you added this to your .js-file:
initialProperties : {
qHyperCubeDef : {
qDimensions : [],
qMeasures : [],
qInitialDataFetch : [{
qWidth : 10,
qHeight : 50
}]
}
},
I am new to this hypercubles
i didn't created any hypercubes yet i dont know where to add this in my js files ?
What do you want to do? The table API helps you work with the data from the hypercube, it does not help you with HTML rows or any other HTML. For that you need standard JavaScript possibly with the help of some library like jQuery, which is included with Qlik Sense.
Hope this helps
Erik Wetterberg
i have to create the simple table with dimensions,measure and total,avg v values for measure will show on ranking order of measure values.