Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ajaykakkar93
Specialist III
Specialist III

Qlik Sense Retrieve chart dimensions and measure information using Javascript

Qlik Sense Retrieve chart dimensions and measure information using Javascript

Hi everyone,

I am trying to retrieve the information of any type visualization using javascript

  • Chart measure - SUM(something), AVG(something), COUNT(something) etc.
  • Chart dimension - Field used to apply the measure
  • Chart - color properties (which color mode is used)
  • Sorting - Asc or Desc.

I'll appreciate some help on this.

Thanks:

Ajay Kakkar

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

1 Solution
4 Replies
ajaykakkar93
Specialist III
Specialist III
Author

Hi erik.wetterberg ,

    i would love if you can give an example.?

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

ErikWetterberg

‌The getProperties Will get you the charts properties, which includes inline mensurens and dimensions. IF the chart utses library dimensions and measures, you will need to make additional calls for those. I have written about that here:

https://extendingqlik.upper88.com/qlik-sense-generic-object-iv-the-lists/

Erik Wetterberg

ajaykakkar93
Specialist III
Specialist III
Author

Hi,

i managed to make this code(this codes works fine), but when i loop through it lot of objects are skipped in between...

var dim, mes, mstedim, mstrmes;

if (model.properties.qHyperCubeDef) {

// dim start

console.log('dim_' + objid, model.properties.qHyperCubeDef);

if (model.properties.qHyperCubeDef.qDimensions["0"]) {

$.each(model.properties.qHyperCubeDef.qDimensions, function(key, val) {

//console.log('dim_'+objid,val);

if (!val.qLibraryId == '' || !val.qLibraryId == "") {

//console.log('libdim_'+objid,getMasterDimById(app,val.qLibraryId));

dim = '<td>' + val.qLibraryId + '</td>';

} else if (!(val.qDef.qFieldDefs).length == 0) {

$.each(val.qDef.qFieldDefs, function(key1, val1) {

//console.log('dim_'+objid,val1);

dim = '<td>' + val1 + '</td>';

});

} else {

dim = '<td>No Dim</td>';

console.log('no dim');

}

});

} else {

dim = '<td>No Dim</td>';

}

// dim end

// mes start

//console.log(model.properties.qHyperCubeDef.qMeasures);

if (model.properties.qHyperCubeDef.qMeasures["0"]) {

$.each(model.properties.qHyperCubeDef.qMeasures, function(key, val) {

//console.log('mes_'+objid,val);

if (!val.qLibraryId == '' || !val.qLibraryId == "") {

//console.log('libmes_'+objid,val.qLibraryId,getMasterMesById(app,val.qLibraryId));

mes = '<td>' + val.qLibraryId + '</td>';

} else if (val.qDef.qDef) {

//console.log('mes_'+objid,val.qDef.qDef);

mes = '<td>' + val.qDef.qDef + '</td>';

} else {

mes = '<td>No Mes</td>';

console.log('no mes');

}

});

} else {

dim = '<td>No Mes</td>';

}

// mes end

var out = tabledata + '' + dim + '' + mes;

$('#drillObj').append(out + '</tr>');

}

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting