2 Replies Latest reply: Jul 24, 2015 12:00 PM by Alan Green RSS

    Qlik Sense custom property on Dimension or Measure

    Alan Green

      Are there any examples out there which show how to sue custom properties in a Qlik Sense Extension for eitehr a measure or dimension.

       

      For example I would like a toggle on each measure - On or off and then be able to read the setting for each measure.

       

      I have been able to create the toggle in the accordion and set it, but I do not know how to read the value.

        • Re: Qlik Sense custom property on Dimension or Measure
          Stefan Walther

          Hi,

           

          I am not 100% sure if I get your requirements correctly - I assume that your other post (Custom property in Qlik Sense extension) is related to the same requirement, right?

           

          So what exactly are you trying to achieve?

           

          Regards

          Stefan

            • Re: Qlik Sense custom property on Dimension or Measure
              Alan Green

              Hi Stefan

               

              Yes it is related to my other post as well.

               

              I have started to create an extension which is a heatmap table.(Similar to conditional formatting in Excel)

               

              I have created an extension which applies the condition to all measures. I am trying to make this more customisable for each measure.

               

              For example I want to be able to set each measures "Colour using Heatmap" to on or off. If On I then want to set the value of maximum.

               

              I have added the following code :

              measures : {

                                                                                              uses : "measures",

                                                                                              min : 0,

                                                                                         

                                                                                              items: {

                                                                                              MySwitchProp: {

                                                                                                              type: "boolean",

                                                                                                              component: "switch",

                                                                                                              label: "Colour using Heatmap",

                                                                                                              ref: "MySwitchProp",

                                                                                                              options: [{

                                                                                                                              value: true,

                                                                                                                              label: "On"

                                                                                                              },

                                                                                                              {

                                                                                                                              value: false,

                                                                                                                              label: "Off"

                                                                                                              }],

                                                                                                              defaultValue: false

                                                                                              },

                                                                                              MyNumProp: {

                                                                                                              type: "number",

                                                                                                              label: "Maximum",

                                                                                                              ref: "myproperties.max",

                                                                                                              defaultValue: "10.5",

                                                                                                              show : function(data) {

                                                                                                                                              return data.MySwitchProp;

                                                                                                                              }

                                                                                              }

                                                                              }

                                                         

                                                                              }

               

              Using the above I can now set the maximum for each measure through the accordion.

               

              I am now trying to see how I capture the values.

               

              I am trying to see the values for each measure of MySwitchProp and MyNumProp. Does this get returned to the layout object?

               

              If so how is this done and where can I view the results?

               

              Regards


              Alan

               

              ----------------------

              Update

              ----------------------

               

              I have found that myproperties are stored in qHyperCubDef. What is the best way to read this and get the values?