Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all, is there a way to auotmatically change the name of the file in the store function or a way where the store function will create multiple files instead of replacing the old file upon upload?
Export:
load
[csId] as 1
,[eCd] as 2
,[te] as 3
Resident Test;;
STORE export into
txt, delimiter is ',');
(
drop Table export
Hi!
LET vName=today();
STORE export into Q:\Monthly Reports\export_$(vName).txt (txt);
You can see this:
Or you can use incremental
let vPath='C:\1';
FOR Each Ext in 'txt'
FOR Each File in FileList ('$(vPath)'&'\*.'&Ext)
Files:
LOAD
'$(File)' as Name,
FileSize( '$(File)' ) as Size,
Replace(Replace('$(File)','$(vPath)'&'\',''),
'.xlsx','') as ShortName,
FileTime( '$(File)' ) as FileTime
AutoGenerate 1;
NEXT File;
NEXT Ext;
t1:
Load
max(PurgeChar(ShortName,'export_.txt')) as num
Resident
Files
Where left(ShortName,7) = 'export_';
Let vName=Peek('num',0,'t1')+1;
drop tables Files, t1;
t1:
LOAD Items,
Locations,
Qty
FROM
(biff, embedded labels, table is Facts$);
//let vName=today();
STORE t1 into C:\1\export_$(vName).txt (txt);
define a variable and use it to create new name to your file
or simple append your file name with some timestamp
like
STORE export into '';
vDate=today();
[export] into Q:\Monthly Reports\export_$(vDate).txt
(txt, delimiter is ',');
OR
STORE [export] into Q:\d771\F88776\SHARED\CompanyRead\Network Informatics\Special Projects\John Mingus\Qlikview\Monthly Reports\export_$(vDate).txt(TXT);
Not recogonizing the variable and I get an error to reload old data after the refresh. See anything incorrect with the syntax above? When I remove the variable in the STORE statment the scrip runs...
Hi John,
Check out the attached application it has the similar code and it does work.
Please check if your access are proper to the folder where your application is trying to store the file
My script runs when I remove the variable piece from the store command. It's only when I add the variable that the script bombs out "Execution of script failed. Reload old data"
can you put a sample qvw replace your load statement with simple inline and keep table name and store statement variable etc same