
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how to set up a config file?
Hi,
I need to set a config file using variables by giving all the useful information like connection string and database name etc which sits outside the qlikview and these variables will pick up the changes automatically depending on the different environments we work like Dev,UAT and Prod.
Wondering if any one has a code how to write it.
Thank you,
Regards,
Sharma.
- Tags:
- new_to_qlikview
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
1.Create a text file and save it in the folder where ur QVW exists.
2.place this sample text in that config file
vConnName='Databasename';
vFilepath= '...\\Data\Dev\filename';
and Save it.
3. Now include the below line in the QVW script
$(Include=Config.txt);
Thats it.
Hope this helps you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could use a QVS file and a must_include directive.
A QVS is a Qlikview Script File. It works like a Qlikview Script, using the same sintax. You can set or let variables, that you can use inside you qvw. But a QVS is a Flat File that you can edit in your favorite Text File Editor, like Notepad. It's great as a configuration file.
I'm attaching a example. In Script Editor Window you can see some code that you can use to do some connection using a variable declared in QVS, like the code below:
//you can user any variable declared in qvs
//like the example below
//Set or let connectionStringVariable in qvs file
//CONNECT $(connectionStringVariable);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another Solution for this is:
Define all the variables in a notepad document and save it as a Config.txt file in the same folder where youe QVW is placed
and in the QVW
place the below script at the startting of the scripting before the actual code.
$(Include=Config.txt);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi karthigayan,
Thanks for your reply.As i am fairly new to scripting i am a bit lost in writing the code.
All i need to do is define some vairables that holds the path of the qvw or qvds and store that in a variable and when there is any changes in the path if i move from dev to prod , i can come to this text and change the path once and it gets reflected all across the qvws.
Can I Pick your brains,
Regards,
Sharma.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
1.Create a text file and save it in the folder where ur QVW exists.
2.place this sample text in that config file
vConnName='Databasename';
vFilepath= '...\\Data\Dev\filename';
and Save it.
3. Now include the below line in the QVW script
$(Include=Config.txt);
Thats it.
Hope this helps you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The solution above it's helpful. I think that will solve your problem.
There is a difference between include and must_include.
A include file is optional and if the included file does not exists no error will be raised and the variables will be blank or null.
A must_include is a required file. If that file not exists a error will be raised to prevent some logical mistake.
I prefer must_include. It's better to discover something wrong during the load that a number mistakes in production!
