Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Store with variable

I have the following scritp which works, but I cannot seem te store the file with a variable filename. What am I doing wrong?

FOR EACH FoundFile IN FILELIST('\\..\*.log')
LET vFile = FileBaseName();


Temp:
LOAD
@1                                                             as FileDate,
@2                                                             as CommandTime,
@4                                                             as Command,
RowNo()                                                        as Row,
subfield(FileName(), '.',1)                       as File

FROM [$(FoundFile)] (txt, unicode, no labels, delimiter is ' ', msq, filters(
Remove(Row, RowCnd(CellValue, 8, StrCnd(contain, 'Execution', not))),
Remove(Col, Pos(Top, 7)),
Remove(Col, Pos(Top, 6)),
Remove(Col, Pos(Top, 5)),
Remove(Col, Pos(Top, 4)),
Remove(Col, Pos(Top, 3))
));

Left join
LOAD
max(Row)                                                    as MaxRows,
File
Resident Temp Group by File;

[$(vFile)]:
NoConcatenate
LOAD
if(MaxRows=1, (Now()-CommandTime))             as CurrentReloadTime,
File
Resident Temp;

Store [$(vFile)] into \\..\LOG $(vFile).qvd (qvd);

Drop Table Temp;
Drop Table [$(vFile)];
      
next FoundFile

1 Reply
Anonymous
Not applicable
Author

i do it with 2 variables and it works fine

 

store $(vAppName) into $(vQVDName)$(vFileExt)

;