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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
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?

Labels (1)
1 Reply
rbecher
Partner - Master III
Partner - Master III

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

Data & AI Engineer at Orionbelt.ai - a GenAI Semantic Layer Venture, Inventor of Astrato Engine