Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview Adhoc

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

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

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

View solution in original post

6 Replies
stigchel
Partner - Master
Partner - Master

You can use the followng for your dimension, it uses dolloar sign expansion (see help)

=[$(=subfield(Concat([$Field],';'),';',1))]

stigchel
Partner - Master
Partner - Master

Dollar-Sign Expansions

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.

Not applicable
Author

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

stigchel
Partner - Master
Partner - Master

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.

Not applicable
Author

ok, Thanks

stigchel
Partner - Master
Partner - Master

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