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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Configuration file for the connection string????

Hi All,

I am getting data from cube to my QlickView document by using the below script.

CONNECT TO [Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=SON1291;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=SON1291;Use Encryption for Data=False;Tag with column collation when possible=False];


AnalyticsPage1:
SQL SELECT * FROM OPENROWSET

('MSOLAP.4',
'Provider=MSOLAP.4;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Adexa;Data Source=SON1291;',

'SELECT {[Measures].[Consensus Fcst Revenue],
[Measures].[Business Plan Revenue],
[Measures].[Gross Margin (Business Plan)],
[Measures].[Gross Margin (Consensus)],
[Measures].[EOH Inventory - Consensus]} ON COLUMNS,
{([Period].[Month],[Prod].[Prod Type])} ON ROWS
FROM [MAIN_SEMI_CUBE];'
);

But now i want to put my connection information into one configuration file which can be modified outside of the QV document by my client.

But here i dont know how to put this in to a config file and what should be my variable value?

Please help me soon.

Its urgent.

Thanks,

Mahasweta

3 Replies
Not applicable
Author

You can use a variable to store connection string and use a configuration file such as connection.txt to pull variable values dynamically from it.

E.g:

In your Edit Script:

--------------------------

set vEnv = 'Test';

Set $(Include=connection.txt);

set vConn = $(vEnv) & ' and ' &  $(vDB);

In your connection.txt file:

-------------------------------------

vEnv='QA';

vDB='TestDB';

Use the above example are reference to parameterize your connection string through the connection.txt file. 

fkeuroglian
Partner - Master
Partner - Master

Hi, you could do that using a mustinclude or include

this functions will take the txt that you put and use it in qlikview

for example:

$(must_include=C:\ConexionPP.txt)

this will use the ConexionPP.txt as your string conexion, there you have to put all the string that you have, using at this way your conection wil be not in the qlikview document

Good luck

Fernando

Anonymous
Not applicable
Author

Using this method of must_include also provides you with the ability to secure the connection string. The location of this folder can be secured so that only certain people can modify/view the details.

Also note that Must_Include will cause a failure error if the file is not found. Whereas Include will continue processing. In this example you would want to use Must_Include.