Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
Hope every one is doing good.
I'm trying to pass dimension using the substring of the $field but I getting following error. Please find the attached sample.
thanks
Raj
You're welcome. Also consider this sentence from the help for $ sign expansion
The replacement is made just before the script statement or the expression is evaluated.
so
=[$(=subfield(Concat([$Field],';'),';',1))]
becomes
Before it is evaluated, just as you would add a field name as dimension
If this has answered your question could please mark the relevant answer correct? It will help others find an answer to a similar question an will let other contributing members know this requires no more attention
You can use the followng for your dimension, it uses dolloar sign expansion (see help)
=[$(=subfield(Concat([$Field],';'),';',1))]
Dollar-sign expansions are definitions of text replacements used in the script or in expressions. This process is known as expansion - even if the new text is shorter. The replacement is made just before the script statement or the expression is evaluated. Technically it is a macro expansion.
A macro expansion always begins with '$(' and ends with ') ' and the content between brackets defines how the text replacement will be done. To avoid confusion with script macros we will henceforth refer to macro expansions as dollar-sign expansions.
Thanks that works for me but I always get confused when to use this in doller expansion and when not to;
Any examples would be great.
Thanks
Raj
Basically, you use dollar sign expansion when qlikview expects something else. In this case, subfield is a string, but you want the values from a field named by that string. In other words, you want the string to be evaluated as a field name.
ok, Thanks
You're welcome. Also consider this sentence from the help for $ sign expansion
The replacement is made just before the script statement or the expression is evaluated.
so
=[$(=subfield(Concat([$Field],';'),';',1))]
becomes
Before it is evaluated, just as you would add a field name as dimension
If this has answered your question could please mark the relevant answer correct? It will help others find an answer to a similar question an will let other contributing members know this requires no more attention