Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

trappersw
Contributor

I'm having trouble reading strings from variables in if-clauses in qlik sense script

Integers in the script: no problem

Strings: doesn't work.

for example

This doesn't work:

set vDAP = 'DEV'

if $(vDAP) = 'DEV' then

     set vServer = 'Devserver';

   

end if

This works:

set vDAP = 1

if $(vDAP) = 1 then

     set vServer = 'Devserver';

   

end if

Suggestions welcome!

1 Solution

Accepted Solutions
MVP
MVP

Re: I'm having trouble reading strings from variables in if-clauses in qlik sense script

set vDAP = 'DEV'

if '$(vDAP)' = 'DEV' then

     set vServer = 'Devserver';

   

end if

i.e. use single quotes when expanding the text variable

2 Replies
MVP
MVP

Re: I'm having trouble reading strings from variables in if-clauses in qlik sense script

set vDAP = 'DEV'

if '$(vDAP)' = 'DEV' then

     set vServer = 'Devserver';

   

end if

i.e. use single quotes when expanding the text variable

trappersw
Contributor

Re: I'm having trouble reading strings from variables in if-clauses in qlik sense script

thanks!

Community Browser