Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ikomlyakov1929
Partner - Contributor III
Partner - Contributor III

Strange behavior of qAttributeExpressions

Hi,

I've got an extension that uses qAttributeExpressions for dimension. The strange behavior is the following:

When i define expression in qAttributeExpressions  like this and then type some expression there

var dimensions = {

       uses: "dimensions",

       min: 1,

       max: 1,

       items: {

            color: {

                 type: "string",

                 label: "Color",

                 ref: "qAttributeExpressions.0.qExpression",

                 expression: 'always',

                 defaultValue: ''

            }

       }

  };

qlik give me the following error

Error from Engine without an RPCSession request, RPC ID: 122

Error from Engine: {jsonrpc: "2.0", id: 122, error: {…}}

     error: {code: -32602, parameter: "JSON type error", message: "Invalid method parameter(s)"}

     id: 122

     jsonrpc: "2.0"

But when i set  'expression' field to empty :

var dimensions = {

       uses: "dimensions",

       min: 1,

       max: 1,

       items: {

            color: {

                 type: "string",

                 label: "Color",

                 ref: "qAttributeExpressions.0.qExpression",

                 expression: '',

                 defaultValue: ''

            }

       }

  };

and type some expression here. Then qlik gives me the right answer even if it's an expression in qAttributeExpressions field.

I'm using Qlik Sense June 2017 Patch 2

1 Solution

Accepted Solutions
jonvitale
Creator III
Creator III

I've got something, try this:

Comment out:

expression: ""

Use:

component: "expression"

Let me know if it works for you.

View solution in original post

7 Replies
jonvitale
Creator III
Creator III

I'm getting the same kind of error, putting the expression to '' didn't help either (well, it helps if it is just a string, but it won't calculate an expression). Very confused!

ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

In my case, i just put the following $(efficiency_group_color) into the field Color and it calculates the expression inside the variable.

Qlik strange.JPG

jonvitale
Creator III
Creator III

Wow, that actually works. What could it mean?

This is a good hack, but it won't work in the long term, I need to have my users be able to write their expression in directly.

Funny thing is I had this working a couple days ago, I'm not sure if I introduced a bug at some point, but I don't know why that would make the engine fail, and not just a run-time error, which I could use the Chrome Developer Tools to debug.

Thanks, any more ideas?

jonvitale
Creator III
Creator III

I've got something, try this:

Comment out:

expression: ""

Use:

component: "expression"

Let me know if it works for you.

ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

I haven't tied this, but I think that this property will be ignored because component could not be expression

Defining custom properties ‒ Qlik Sense

jonvitale
Creator III
Creator III

Yup, it has no documentation, but it seems to work. Try it.

ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

Hi Jonathan!

I've tried and it looks like a good undocumented solution. Thanks!