2 Replies Latest reply: Sep 7, 2016 5:32 AM by fabrizio martiner RSS

    List of measures in dropdown

    fabrizio martiner

      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!

        • Re: List of measures in dropdown
          Miguel Braga

          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

          • Re: List of measures in dropdown
            fabrizio martiner

            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>");
              });