Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can we set path variables?

I need in deep how to set the path vriables if we need to deploy the qwv like shifting the qwv to another location.What we need to do in Edit script.

5 Replies
Not applicable
Author

with an example is good

Agis-Kalogiannis
Employee
Employee

First of all if you just need to change the location of your qvw and not your datasources, using absolute paths is enough.

Just clear the checkbox that says Relative Paths next to the Table Files button in your script editor.

If you definitely need to create a variable, then you can do it like this:

SET vPath = 'c:\data\qvw\';

and then use this variable when you are loading your data files in the from statement

LOAD

...

FROM

$(vPath)filename.xls

I hope this helps

Regards

Agis

oknotsen
Master III
Master III

I would never work with absolute paths, sorry Agis.

Work with the same directory structure (and test data sources) in both development, test and production environment.

You can set a variable with starting points of your relative path (if you really have to adjust them, but best practice is work with the same structure in all environments) by using the "Directory" command.

You could than story this in a txt file and including this file in your script. If you than move your QVW to a new location, it will automatically point to a new include file which contains your new relative path starting point.

Hope this helps / is useful.

May you live in interesting times!
Agis-Kalogiannis
Employee
Employee

You are right there Onno. The reason I mentioned absolute paths, is because Kishore mentioned that he might need to shift the qvw file to a different location, and not the entire structure, so this is quite an easy way to do it.

But still, even if we decide to go with absolute path, keeping al the variables externally into a table would be even better, rather than the script.

buzzy996
Master II
Master II

try like this,

define a variables in ur first tab,

Let vDrive='\ur network path\QlikviewProd';

SET QVDPath = '\\ur network path\qvds Documents';

SET PublicSrcPath = '\\ur network path\qvws Documents';

and use those variable throughout ur application scripts.

xxxxxxxx

From tblname

CONCATENATE ($(vBASE_TableName)) LOAD * FROM $(vQvdFile) (qvd)

WHERE NOT exists($(vPK));

STORE $(vBASE_TableName) INTO $(vQvdFile);

STORE FOLDERS INTO [$(QVDPath)\CPA_FOLDERS.qvd];

like through out script u can use ur variables instituted of defining paths again and again.