Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar
MVP
MVP

Try using set analysis instead of if statement:

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

Capture.PNG

View solution in original post

4 Replies
sunny_talwar
MVP
MVP

May be try it like this:

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

Sample:

Capture.PNG

Not applicable
Author

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

sunny_talwar
MVP
MVP

Try using set analysis instead of if statement:

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

Capture.PNG

Not applicable
Author

Excellent - thanks again !

Nick