Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following formula for a dollar-sign expansion with one parameter:
pick(2+sign($(=only({1<[_MasterItemName]={'$1'}>} [_MasterItemExpression1]))),'#FF0000','#888888','#008800')
If I enter this value exactly as is in the variable window of the edit-mode (I use a variable named color), it works correctly: calling $(color(MasterItemName)) returns me what I want.
But, I cannot seem to make this work if I do the variable assignment on-script. I've tried bot set and let, and both as seen above, and escaped the single quotes with two single quotes.
Any ideas?
Hi, loading expression from an excel file helps to avoid to use escape character for quotes and $, also helps to centralize maintenance.
https://community.qlik.com/t5/QlikView-App-Dev/Set-Analysis-in-Expression-Chart/m-p/187444#89749
In script maybe doesn't works because you also need to scape the $ character, in example you can use:
set varStart = pick(2+sign(&(=only({1<[_MasterItemName]={|&1|}>} [_MasterItemExpression1]))),|#FF0000|,|#888888|,|#008800|)
let varEnd = replace(replace('$(varStart),'&','$'),'|',Chr(39));
Hi, loading expression from an excel file helps to avoid to use escape character for quotes and $, also helps to centralize maintenance.
https://community.qlik.com/t5/QlikView-App-Dev/Set-Analysis-in-Expression-Chart/m-p/187444#89749
In script maybe doesn't works because you also need to scape the $ character, in example you can use:
set varStart = pick(2+sign(&(=only({1<[_MasterItemName]={|&1|}>} [_MasterItemExpression1]))),|#FF0000|,|#888888|,|#008800|)
let varEnd = replace(replace('$(varStart),'&','$'),'|',Chr(39));
Excellent, thanks! For future reference, you are missing a terminating semicolon on the end of the first command, and also a single quote after the (varStart) of the second