Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

yblake
Contributor 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
Contributor II

Re: How to evaluate detailed expressions in an extension ?

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

6 Replies
erik_wetterberg
Valued Contributor III

Re: How to evaluate detailed expressions in an extension ?

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

Erik Wetterberg
https://extendingqlik.upper88.com/
akl
Honored Contributor

Re: How to evaluate detailed expressions in an extension ?

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
Contributor II

Re: How to evaluate detailed expressions in an extension ?

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
Valued Contributor II

Re: How to evaluate detailed expressions in an extension ?

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

yblake
Contributor II

Re: How to evaluate detailed expressions in an extension ?

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
Contributor III

Re: How to evaluate detailed expressions in an extension ?

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