Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
crichter14
Creator
Creator

Using Variables in a file path

OK a few things going on here.

1.  Created an include file in text which pulls in the file path variables below:

Here is the TEXT document (not in QLIK).

/* Variables for Directory Storage */

SET vQVD_E_Directory = '...\01_ExtractQVD';

SET vQVD_T_Directory = '...\02_TransformQVD';

SET vModelFile      = '..\03_data_model_qvw';

Let vToday = Date(today(), 'DD-MMM-YYYY');

Let vLoadTime = Date(today(), 'DD-MMM-YYYY');

Let vDateFormat =           'DD-MMM-YYYY';

Let vMonthFormat =       'MMM-YYYY';

2.  Wrote the script to use the variables below:

Here is the QLIK load script.

$(Include=..\includes\include.txt);

TEST:

LOAD * INLINE [

MATRIX_TYPE, MATRIX_TYPE_DESCRIPTION

TYPE1,'Entered'

];

STORE TEST INTO [$(vQVD_E_Directory)]\TEST.QVD(qvd);

QUESTION:  I know the Include file is there.  I know the variable for the relative file path is in the variables for the application.

When I get to the STORE statement, it bombs out.  NO WHERE have a found what the heck a variable file path looks like when used with a static (non-variable named) file.

Can someone spell this out for me?  I've tried brackets, quotations, single and double, then I've tried nothing at all (i.e. $(vQVD_E_Directory)]\TEST.QVD(qvd)).  What am I missing?

Syntax is what I need if anyone knows what it is.

2 Replies
sasiparupudi1
Master III
Master III

is it 3 dots I see?

SET vQVD_E_Directory = '...\01_ExtractQVD';

SET vQVD_T_Directory = '...\02_TransformQVD';

secondly,

Change

$(Include=..\includes\include.txt);

to

$(Must_Include=..\includes\include.txt);


third

Use

TRACE '$(vQVD_E_Directory)'



STORE TEST INTO $(vQVD_E_Directory)\TEST.QVD(qvd);



enable the log file in document settings and check it out how it excuted the script.



hth

swuehl
MVP
MVP

Take also care to enclose the complete path with your square brackets, including the file name and extension:

STORE TEST INTO [$(vQVD_E_Directory)\TEST.QVD] (qvd);