Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

compare variables values in script

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.

4 Replies

compare variables values in script

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

compare variables values in script

Or, expand the variable but surround it with quotes:

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

Not applicable

compare variables values in script

thank you,

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

compare variables values in script

Hi,

Check this post about variables, expansion and evaluation.

Hope that helps.