Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Dynamic Server Connection Qlik Sense

I would like to create a connection to a sql server in qlik sense, but I would like the server to be driven by a variable.  Is this possible?  

 

thanks for your advice!

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Creator II
Creator II

Yes, it is possible to dynamically make connections. This is how it works:

  • Load a table with connection parameters
  • Use the peek() function to extract the connection parameter values (e.g. username and password) from the table and store them in variables.
  • Use the $-sign substitution to replace username and password at the end of your connection string when executing a CONNECT TO statement

You can best start from an existing CONNECT TO statement with unscrambled credentials. For an OLE DB connection, there are user ID and password parameters that accept unscrambled values. For example (using the SQL Server Native Client):

 

CONNECT TO

[Provider=SQLNCLI11;Server=$(vServerAddress); Database=$(vDataBase);Uid=$(vUsername);Pwd=$(vPassword);];

 

You can find the exact connection string in the QMC > Data connections > YourConnector > Connection string

 

Hope it helps!

 

 

View solution in original post

2 Replies
Highlighted
Creator II
Creator II

Yes, it is possible to dynamically make connections. This is how it works:

  • Load a table with connection parameters
  • Use the peek() function to extract the connection parameter values (e.g. username and password) from the table and store them in variables.
  • Use the $-sign substitution to replace username and password at the end of your connection string when executing a CONNECT TO statement

You can best start from an existing CONNECT TO statement with unscrambled credentials. For an OLE DB connection, there are user ID and password parameters that accept unscrambled values. For example (using the SQL Server Native Client):

 

CONNECT TO

[Provider=SQLNCLI11;Server=$(vServerAddress); Database=$(vDataBase);Uid=$(vUsername);Pwd=$(vPassword);];

 

You can find the exact connection string in the QMC > Data connections > YourConnector > Connection string

 

Hope it helps!

 

 

View solution in original post

Highlighted
Contributor III
Contributor III

So use the same concept that was in the include in qlikview and update the connection string in cmc for the library?   

 

Thanks for the advice!