Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have some problem getting a set analysis expression to work when using a variable.
My expression looks like this:
sum({$<Product={$(vProduct)}>} Output)
and the variable can take on two different values, W12V32 and 9R32.
If the variable takes on value W12V32 the expression above works fine, however if the variable takes on the value 9R32 it does not work.
However, the expression works fine if i hardcode it like this:
sum({$<Product={'9R32'}>} Output)
Unfortunately this is not an option for me.
So what could be the problem?
v.10 SR4
You can try embedding your variable expansion into single quotes:
sum({$<Product={'$(vProduct)'}>} Output)
And check if the dollar sign expansion returns the result you expect (e.g. by not setting a label for the expression, so you get the expanded expression shown in your chart as label).
Thanks swuehl,
I checked the label and it said:
sum({$<Product={9R32}>} Output)
I changed the variable so that it took on the value of '" 9R32 "' (i.e. both single and double quotes, double on the inside).
The label then changed to
sum({$<Product={"9R32"}>} Output)
and the expression started working.
I also tried using two single quotes (i.e. ''9R32'') but that did not work. Well newermind, main thing is that it works (Just thought that it would have been more coherent).
Thanks!