1 Reply Latest reply: Oct 10, 2017 5:56 AM by André Sousa Silva RSS

    Custom property in Qlik Sense measure

    Alan Green

      Can someone please share with me how to create a custom property on a measure in Qlik Sense.

       

      I have been able to create custom properties in the Appearance section but now would like to have a property against a measure.

       

      I am looking for a switch of On / Off. If On then 2 test boxes are to be display for a min value and a max value.

       

      Something similar to how the Formatting switch works would also be a good example.

        • Re: Custom property in Qlik Sense measure
          André Sousa Silva

          I got to do something like that. I was not able to get the minimum and maximum based on the measure.

           

          primaryAxis :{

                          type: "items",

                          label: "Primary axis",

          items:{

          range: {        

                                  ref: "properties.primaryAxis.range",

                                  component: "switch",

                                  options: [

          { value: true, label: "Custom" },

          { value: false, label: "Auto" }

          ],

                                  label: "Range",

                                  type: "boolean",

                                  defaultValue: false

                              },

          /*customRangeType: {  

                                  type: "string",

                                  component: "dropdown",

                                  label: "",

                                  ref: "properties.primaryAxis.customRange.type",

                                  options: [

                                      { value:"min", label:"Min", tooltip:"Min"},

          { value:"max", label:"Max", tooltip:"Max"},

                                      { value:"min/max", label:"Max", tooltip:"Min/Max"}

                                  ],

                                  defaultValue:"min/max",

          //show:function(e){ return false || true; } <---funciona assim

          show:function(e){ return e.properties.primaryAxis !== undefined && e.properties.primaryAxis.range === false; }

                              },*/

                              customRangeMin: {       

                                  ref: "properties.primaryAxis.customRange.min",

                                  type: "integer",

                                  label: "Min",

                                  expression: "optional",

                                  defaultValue: 0,

          //show:function(e){ return e.properties.primaryAxis !== undefined && (e.properties.primaryAxis.customRange.type === "min" || e.properties.primaryAxis.customRange.type === "min/max") ; }

          show:function(e){ return e.properties.primaryAxis !== undefined && e.properties.primaryAxis.range === true; }

          },

          customRangeMax: {      

                                  ref: "properties.primaryAxis.customRange.max",

                                  type: "integer",

                                  label: "Max",

                                  expression: "optional",

                                  defaultValue: 0,

          //show:function(e){ return e.properties.primaryAxis !== undefined && (e.properties.primaryAxis.customRange.type === "max" || e.properties.primaryAxis.customRange.type === "min/max") ; }

          show:function(e){ return e.properties.primaryAxis !== undefined && e.properties.primaryAxis.range === true; }

          }

          }

          },