Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mattbrain
Contributor
Contributor

Store QVD file, using field name

Hi

Can anyone help with this please, I am really struggling.

I have a typical load script as below, that will only ever contain one row of data:

table:

LOAD 1,2,3,4,HOSTNAME

The hostname is a file path, example c:\file.csv or \\pcname\c$\file.csv

I am then trying to store the file,

store [table] into [$HOSTNAME] (txt, delimiter is '|');

Whenever the script is run, it should dynamically store the file, according to the folder/file location in the HOSTNAME field.

Can anyone help please, have trawled the forums for hours searching for an example that works.

Thanks

3 Replies
agomes1971
Specialist II
Specialist II

Hi,

try this:

FOR vCount = 0 to NoOfTables()-1

     LET vTableName = TableName($(vCount));

     STORE $(vTableName) INTO $(vTableName).qvd (qvd);

NEXT vCount

HTH

André Gomes

mattbrain
Contributor
Contributor
Author

Thanks, how would I work that to my example, when I run this it calls the file "table" as thats the table name, but I want the file name to be the data contained within HOSTNAME table?

Really appreciate your help

agomes1971
Specialist II
Specialist II

OK,

maybe something like this:

Table:

LOAD 1,2,3,4,[HOSTNAME]

from yoursource;

LET vHostName = peek([HOSTNAME],0);

YourData:

LOAD * from yoursource;

STORE YourData into vHostName.qvd (qvd);

HTH

André Gomes