Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
master_t
Partner - Creator II
Partner - Creator II

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
Partner - Creator II
Partner - Creator II
Author

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.

View solution in original post

1 Reply
master_t
Partner - Creator II
Partner - Creator II
Author

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.