Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic expressions without Pick

Hi,

I have a scenario where the table looks like this.

MetricName, VariableName

m1, v1

m2,v2

m3,v3

m4,v4

I need to display a chart with "MetricName" and the result of the evaluation of the variable in a chart. Let us say the variable contains sum(<field>).

Can't get it to work. Anyone tried this. Please see the attachment. However it works when you select just one metric.

4 Replies
marcus_sommer

It's not possible in this way because you will need $-sign expansion to evaluate the expression and this will be caluculated only once before the chart is calculated and then applied for each row. Therefore you will need mandatory an approach with if-loops or better a pick(match()) to get unique expression for each row - whereby this could be applied automatically, see also:

AllowMacroFunctionsInExpressions AND ActiveDocument.Evaluate()

https://community.qlik.com/ideas/4429#comment-45051

- Marcus

christophebrault
Specialist
Specialist

Hi,

See the attached document

Use Valuelist() as a dimension and then and if statement in your expression to change it depending on the value in valuelist() function

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
sunny_talwar

I think do this, you won't even need a synthetic dimension. But I guess the issue is that using pick or if over large number of dimension is what the OP is trying to avoid.

Attaching the non-valuelist version of your proposed solution

lavielme
Creator
Creator

Hay All

Thank's For Your Help

But I'M Trying To Avoied From If Statement

To Optimize The Performance to Some Model

That is The Reson That I posted This Quastion