Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Variables as file and table paths in load script

Hi,

I'd like to assign table names and source files to variables and use it throughout my load script.  Like so..

SET vSourceFileName0 = 'source_file_1.csv';

SET vSourceFilePath0 = 'C:\my files\Sept2013\';

SET vSourceTableName0 = 'MS_SQL_table_1';

MySQLTable:

SQL SELECT * FROM vSourceTableName0;

MyFileSource:

LOAD *

FROM

vSourceFilePath0 & vSourceFileName0

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, no eof);

Doesn't seem to be working...

1 Solution

Accepted Solutions
Highlighted
Partner
Partner

Hi,

SET vSourceFileName0 = 'source_file_1.csv'; 

SET vSourceFilePath0 = 'C:\my files\Sept2013\'; 

SET vSourceTableName0 = 'MS_SQL_table_1'; 

 

MySQLTable: 

SQL SELECT * FROM $(vSourceTableName0); 

 

MyFileSource: 

LOAD * 

FROM 

$(vSourceFilePath0)$(vSourceFileName0)

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, no eof);

Regards,

Aurélien

View solution in original post

2 Replies
Highlighted
Not applicable

Hi,

Try to retrieve the variable value with $(vSourceFileName0)

Highlighted
Partner
Partner

Hi,

SET vSourceFileName0 = 'source_file_1.csv'; 

SET vSourceFilePath0 = 'C:\my files\Sept2013\'; 

SET vSourceTableName0 = 'MS_SQL_table_1'; 

 

MySQLTable: 

SQL SELECT * FROM $(vSourceTableName0); 

 

MyFileSource: 

LOAD * 

FROM 

$(vSourceFilePath0)$(vSourceFileName0)

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, no eof);

Regards,

Aurélien

View solution in original post