Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

List of measures in dropdown

Hi All, I would like to create a mashup project with dropdown containing all measures. Is it possible and how can I do it?

Thanks!

Tags (2)
1 Solution

Accepted Solutions
Not applicable

Re: List of measures in dropdown

I find a solution. The code below:

app.createGenericObject({ 
  qMeasureListDef : { 
qType: "measure", qData: { title: "/title", tags: "/tags",  "measure": "/qMeasure" } 
  } 
}, function(reply){ 
  var myObject = reply.qMeasureList.qItems; 
  var str = ""; 
  $.each(reply.qMeasureList.qItems, function(key, value) { 
var title = ""; 
var fx = ""; 
var combined = ""; 
title = JSON.stringify(value.qData.measure.qLabel) ; 
title = title.replace(/['"]+/g, '') 
fx = JSON.stringify(value.qData.measure.qDef) ; 
fx = fx.replace(/['"]+/g, '')
$("#dropdownMeasures").append("<li value='" + fx + "'>"  + title + "</li>");
  });
2 Replies
miguelbraga
Valued Contributor III

Re: List of measures in dropdown

Hey there,

The only way I see to get what you require is by creating a "Filter pane chart" and adding manually all fields in it.

Regards,

MB

Not applicable

Re: List of measures in dropdown

I find a solution. The code below:

app.createGenericObject({ 
  qMeasureListDef : { 
qType: "measure", qData: { title: "/title", tags: "/tags",  "measure": "/qMeasure" } 
  } 
}, function(reply){ 
  var myObject = reply.qMeasureList.qItems; 
  var str = ""; 
  $.each(reply.qMeasureList.qItems, function(key, value) { 
var title = ""; 
var fx = ""; 
var combined = ""; 
title = JSON.stringify(value.qData.measure.qLabel) ; 
title = title.replace(/['"]+/g, '') 
fx = JSON.stringify(value.qData.measure.qDef) ; 
fx = fx.replace(/['"]+/g, '')
$("#dropdownMeasures").append("<li value='" + fx + "'>"  + title + "</li>");
  });