Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good afternoon,
I would like to use a variable as field name in a set expression:
vSystem is a variable which I feed with a list chart and can be 1,2 or 3.
I need to use it like these expresions:
Sum({<vSystem={"1"}>} Quantity)
or
Sum({<$(vSystem)={"1"}>} Quantity)
But doesn´t work.
Thanks in advance.
I don't use expressions in left size of set analysis but I was curious to test it, I wanted to do it when I saw @rwunderlich post few months back https://qlikviewcookbook.com/2022/03/expression-as-left-side-of-set-modifier/ but couldn't get chance to do that.
It worked for me though, hope you don't have '=' before the value of your variable
It will work if your variable contained a valid field-name respectively the expression returned a valid field-name - anything else won't work. A valid field-name means further that values which contain any space or special char are wrapped with quotes or brackets like "Field A" or [Field X] respectively that's called in this way like:
sum({< [$(var)] = {'x'}>} value)
- Marcus