Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

How to evaluate a variable to a field in an expression

I'm sure there's a straightforward answer to this, but I can't find it I'm afraid.

I want to include a variable field in a chart expression.

e.g. suppose the expression is sum( {$<Product = {}>} Sales). It's the Product bit that I want to vary.

So what I want to do is something like sum( {$<field(vVariable) = {}>} Sales), so that by changing vVariable, the expression uses a different field.

I can't seem to evaluate the variable to become an actual reference to a field, if you see what I mean. Can this be done?

Thanks as always

James

3 Replies
Not applicable

How to evaluate a variable to a field in an expression

He James,

This is possible:

sum( {$<field = {'$(=(vVariable)'}>} Sales)

If you are using a date field you have to make sure that the format of the variable is equal to format of the field.

Good luck.

Frank

Not applicable

How to evaluate a variable to a field in an expression

James,

I misread your question;

I think you need this:

sum( {$<$(vVariable) = {}>} Sales)


Not applicable

How to evaluate a variable to a field in an expression

Try this       sum($(=vVariable) Sales)

Community Browser