Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Not applicable

Loading expressions into QV from a file

HI All,

I have a ridiculous chart to create :-) with hundreds of columns (but will control show / hide via conditional to make it usable).

Entering expression on screen for this volume is a nightmare, so what I want to do is load something like this...

Metrics:
LOAD * INLINE [_MetricCode,_Metric_Name,_MetricExpression
MAA,   Sales    ,sum(SALES)
];

& then have a chart that uses the expression..

=if(_MetricCode='MAA',_MetricExpression)

.. hoping the resulting expression column would be the sum of my sales i.e. £100

... however I am getting the 'text' as a result in the column i.e.  'sum(SALES'.

Is there a way please to tell the expression the result is a formulae ?

Thanks in advance

Nick

1 Solution

Accepted Solutions
MVP
MVP

Re: Loading expressions into QV from a file

Try using set analysis instead of if statement:

$(=Only({<_MetricCode = {'MAB'}>}_MetricExpression))

Capture.PNG

4 Replies
MVP
MVP

Re: Loading expressions into QV from a file

May be try it like this:

$(=if(_MetricCode='MAA',_MetricExpression))

Sample:

Capture.PNG

Not applicable

Re: Loading expressions into QV from a file

Oops it only works when you have one expression logic - as soon as you have 2 or more it doesn't :-(

Any ideas please ?

Thanks again

Nick

MVP
MVP

Re: Loading expressions into QV from a file

Try using set analysis instead of if statement:

$(=Only({<_MetricCode = {'MAB'}>}_MetricExpression))

Capture.PNG

Not applicable

Re: Loading expressions into QV from a file

Excellent - thanks again !

Nick