Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have month wise data in D drive. Say 09-2014,08-2014 and 07-2014.
How to get the data into qlikview based on the file name.
Thanks
Hello,
As I don't know your exact purpose, here you have some tools for file management:
If you want to know if a file exists or not:
if filetime('c:\mydata\my.qvd) then
//qvd exists
else
//qvd doesn't exist
end if
You can go further the filetime function to control which file you want to import or not, depending of its creation timestamp.
If you want to have a look in a folder:
Directory;
FOR Each File in filelist ('.\BUFFER_*.xlsx')
LOAD *
FROM
'$(File)'
(ooxml, no labels, table is Sheet1);
NEXT File;
Maybe your solution needs a combination of all these.
Hope it helps.
Marc.
Use a * as a wildcard instead of the full file name. The files will be concatenated if the fields have identical names.
So for instance:
load .... from 09-2014.qvd; will become
load ... from *.qvd;
Hello,
As I don't know your exact purpose, here you have some tools for file management:
If you want to know if a file exists or not:
if filetime('c:\mydata\my.qvd) then
//qvd exists
else
//qvd doesn't exist
end if
You can go further the filetime function to control which file you want to import or not, depending of its creation timestamp.
If you want to have a look in a folder:
Directory;
FOR Each File in filelist ('.\BUFFER_*.xlsx')
LOAD *
FROM
'$(File)'
(ooxml, no labels, table is Sheet1);
NEXT File;
Maybe your solution needs a combination of all these.
Hope it helps.
Marc.
Please explain the second code.
lets I have a file name AAA.txt and BBB.txt. can I load each based on the above code??
Load with a wildcard (*):
*.txt will load both files and concatenate the same fields.
In case you want to load every txt file in this folder, do:
load ... from *.txt;
In case you need to load both files but you can not asure they exist, do:
if filetime('AAAA.txt') then
load * from AAAA.txt;
end if
if filetime('BBBB.txt') then
load * from BBBB.txt;
end if