Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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
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...
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.
Any updates on this issue ? I'm looking for the same answer.
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
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