Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yblake
Partner - Creator II
Partner - Creator II

How to evaluate detailed expressions in an extension ?

Is it possible to add a expression in custom property, which would be evaluated for each hypercube cell, outside measures panel ?

I tried :

myAccordion : {

  label : "My Accordion",

  type : "items",

  items : {

    mySort : {

      ref : "myProperties.myExpression",

      type : "string",

      label : "My Expression",

      defaultValue : "",

      expression : "always"

    }

  }

}

This will gives me the expression evaluated globally.

But I would like to get the expression evaluated for each hypercube cell, like "Color by expression" property does for standard objects.

I tried adding  expressionType : "measure" (not documented) without success.

Any help would be appreciated,

Regards.

1 Solution

Accepted Solutions
yblake
Partner - Creator II
Partner - Creator II
Author

Hi Pablo,


I found this trick to get it working...

InformationLabelProp: {

  type  : 'string',

  component: 'expression',

  label : 'Evaluates for each row',

  ref  : 'qAttributeExpressions.0.qExpression',

  defaultValue: ''

},


You'll find more details in this post : Qliksense custom measure property for extension with expression value

Regards

View solution in original post

6 Replies
ErikWetterberg

Hi,

Do you really want the expression for each cell?? Not for each row??

What about simply adding one more measure? It will be calculated for each row in the result set. Should the user be able to define this measure? Or do you want to set it programatically??

Erik

Alexander_Thor
Employee
Employee

As Erik mentioned it might be a bit overkill to it per cell basis?
Either way have a look at the Generic Object Definition documentation as it contains all the properties that can be set.

For example, your extension can have more than 1 hypercube definition, your hypercube can also contain self-contained expressions (useful for stdev calculations for example).

In this case I guess that you could use what we call Attribute Expressions, similar to how colors can be defined per row value. It's an extra expression associated with your measure.

You can find the definition here https://help.qlik.com/sense/en-us/developer/index.html#../Subsystems/EngineAPI/Content/GenericObject...

yblake
Partner - Creator II
Partner - Creator II
Author

Sorry for late answer, thanks for your answers.

My intent is to get an expression evaluated for each hypercube row (not cell).

How can I modify Hypercube definition directlly from property panel ? If someone can post some code example for setting an additionnal self-contained expression, it would be usefull.

pablolabbe
Luminary Alumni
Luminary Alumni

Any updates on this issue ? I'm looking for the same answer.

yblake
Partner - Creator II
Partner - Creator II
Author

Hi Pablo,


I found this trick to get it working...

InformationLabelProp: {

  type  : 'string',

  component: 'expression',

  label : 'Evaluates for each row',

  ref  : 'qAttributeExpressions.0.qExpression',

  defaultValue: ''

},


You'll find more details in this post : Qliksense custom measure property for extension with expression value

Regards

jonvitale
Creator III
Creator III

Months later...

Really, this evaluated for you? I tried basically the same thing (outside of the expression definitions), and all I see is the unevaluated expression in the layout at: layout.qAttributeExpressions[0].qExpression.

This is driving me nuts!

akl