Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

master_t
New Contributor III

Attribute expression in custom extension not working

Hi everyone

I'm writing a Visualization Extension for QlikSense, and I'm trying to add a custom expression to a measure so it will be evaluated for each row. As a guide, I'm using the example from the accepted answer here: Qliksense custom measure property for extension with expression value


Here's my definition:

definition : {

    type : "items",

    component : "accordion",

    items : {

        dimensions : {

            uses : "dimensions",

            min : 1

        },

        measures : {

            uses : "measures",

            min : 1,

            items: {

                VisibilityExpressionProperty : {

                    type: "string",

                    label: "Column visibility condition",

                    ref: "qAttributeExpressions.0.qExpression",

                    component: 'expression',

                    defaultValue: ""

                }

            }

        },

        sorting : {

            uses : "sorting"

        },

        settings : {

            uses : "settings",

            items : {

                initFetchRows : {

                    ref : "qHyperCubeDef.qInitialDataFetch.0.qHeight",

                    label : "Initial fetch rows",

                    type : "number",

                    defaultValue : 50

                }

            }

        }

    }

}

In the example I linked above, the author says that this should result in having the expression available in the hypercube, like this:

qHypercube.qDataPages[0].qMatrix.qAttrExps

However, this is not the case. As you can see, my matrix only contains the objects, but not the extra attribute:

Image 2.png

Can anyone tell me why?

Also, is this stuff documented anywhere in the official documentation? I only found it by google searching....

1 Solution

Accepted Solutions
master_t
New Contributor III

Re: Attribute expression in custom extension not working

Solved it.

Apparently, the attribute only gets added if the value is not null. I thought that setting defaultValue: ""  would give me an empty string, but apparently not, its treated as NULL.

1 Reply
master_t
New Contributor III

Re: Attribute expression in custom extension not working

Solved it.

Apparently, the attribute only gets added if the value is not null. I thought that setting defaultValue: ""  would give me an empty string, but apparently not, its treated as NULL.

Community Browser