Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I want to create a environment variable.
Actually we are doing development in test server then we move to prod sever.
Application has path like [\\100.10.0.10\Qlikview\Data\filename.xls] --------- in test server
Whenever I move to prod it will get failed due to path error, prod server (IP) name is different, path should be like this [\\1001.11.0.11\Qlikview\Data\filename.xls]'----- in prod server
So I created environment variable like as
LET vServerName = ComputerName();
IF ComputerName = 'Devservername' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
However its not working, it execute always else condition (actually vEnv should contain \\100.10.0.10 but it contain \\1001.11.0.11.
There is any mistake in the code.
Could you please assist on this.
Thanks,
Nihhal.
May be put the variable within single quotes
LET vServerName = ComputerName();
IF '$(vServerName)' = 'Devservername' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
You meant this?
LET vServerName = ComputerName();
IF $(vServerName) = 'Devservername' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
try like this
IF ComputerName() = 'Devservername' then
Yes Sunny, even not working.
May be put the variable within single quotes
LET vServerName = ComputerName();
IF '$(vServerName)' = 'Devservername' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
Thanks sunny.
this one also helpful.
LET vServerName = ComputerName();
IF ComuterName() = '$(vServerName)' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
This IF statement will always be true my friend Because your variable is also ComputerName()... Did you mean this
LET vServerName = 'Devservername';
IF ComuterName() = '$(vServerName)' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
Just I missed () sunnay as Avinash said.
working this without vServername variable
//LET vServerName = ComputerName(); -- not required
IF ComputerName() = 'Devservername' then
SET vEnv = '\\100.10.0.10';
else
SET vEnv = '\\1001.11.0.11';
ENDIF
Hahahaha yes, I guess I thought that you wanted to do this in two steps where you first assign the value of ComputerName() to a variable and then use that... but yes, it can be done in a single step also....
Hi Sunny,
After all my practice.
If I go without storing servername in a variable (single step), it works wired (first time it works fine after that it works as unexpected.
Best practice is storing server name into variable (two steps).
LET vServerName = ComputerName();
IF ComputerName() = 'servername'