Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Choose connection string based on computer name

I have a connection string that works on one pc, but not on the other, and vice versa..

So two connection strings.

What I want to do is have an if satement that checks the computer name, and if its computer A, then use connection 1, else use connection 2.

How do I do this?

1 Reply
rbecher
MVP
MVP

Hi,

just do it like this:

if ComputerName() = 'COMPUTER_A' then

     CONNECT DB1....;

elseif ComputerName() = 'COMPUTER_B' then

     CONNECT DB2....;

else

     exit script;

end if

- Ralf

Astrato.io Head of R&D