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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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
Author

James,

I misread your question;

I think you need this:

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


Not applicable
Author

Try this       sum($(=vVariable) Sales)