Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

compare variables values in script

how do i do this?

set v1='x';

if $(v1)='x' then

set v2='y';

end if

is it possible?

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

You are almost there, just don't expand the variable

set v1='x'; if v1 ='x' then set v2='y';end if


Hope that helps.

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hi,

You are almost there, just don't expand the variable

set v1='x'; if v1 ='x' then set v2='y';end if


Hope that helps.

Not applicable
Author

Or, expand the variable but surround it with quotes:

if '$(v1)' = 'x' then

Not applicable
Author

thank you,

just to understand, in general what is the difference between writing $(v1) and v1 ?

Miguel_Angel_Baeyens

Hi,

Check this post about variables, expansion and evaluation.

Hope that helps.