Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i want to pick up the Recent file from the Given folder and coding is picking up the recent file as expected
but when i removed the recent file
for example: i have removed the file which is having the data file of - sample_Download_20180209
when i reload the data Qlikview throwing the Error "Cannot open file '\\Naren\in\sample\sample_Download_20180209.CSV'The system cannot find the file specified."
My Doubt is When i removed the Current data file it need to fetch the previous data file from the folder sample_Download_20180208
Coding as Follow:
Let vFilePath ='\\Naren\in\sample\sample_Download_';
FOR EACH file in FileList('$(vFilePath)*.csv'); // Loops each excel file in the given Folder t
LET vYears = mid(file,26,27);
LET vDates = mid(vYears,14,14);
LET vSM = Rangemax(vDates,vSM);
Next
Sample:
ID,
Name,
Desg
FROM
[$(vFilePath)$(vSM).csv]
(txt, utf8, embedded labels, delimiter is '|', no quotes, no eof)
loveisfailpcammaertstalwar1luismadrizelixir.seajetqlikcheepirishettyjontydkpikaushalkaushik
Hi,
Try this,
Let vFilePath ='\\Naren\in\sample\sample_Download_';
Let vSM =;
FOR EACH file in FileList('$(vFilePath)*.csv'); // Loops each excel file in the given Folder t
LET vYears = mid(file,26,27);
LET vDates = mid(vYears,14,14);
LET vSM = Rangemax(vDates,vSM);
Next
Sample:
ID,
Name,
Desg
FROM
[$(vFilePath)$(vSM).csv]
(txt, utf8, embedded labels, delimiter is '|', no quotes, no eof)
You can also try,
Let vFilePath ='\\Naren\in\sample\sample_Download_';
Let vSM =;
FOR EACH file in FileList('$(vFilePath)*.csv'); // Loops each excel file in the given Folder t
LET vDates = Replace(Subfield(SubField(file,'\',-1),'_',-1),'.csv','');
LET vSM = Rangemax(vDates,vSM);
Next
Sample:
ID,
Name,
Desg
FROM
[$(vFilePath)$(vSM).csv]
(txt, utf8, embedded labels, delimiter is '|', no quotes, no eof)
Have a look at this : Load Latest file from a folder into Qlikview
Hi,
what is expected output here?
Have you test this in a texbox With mid function?
LET vYears = mid(file,26,27); mid(file,1,26) gives you the Whole filename
LET vDates = mid(vYears,14,14);
LET vSM = Rangemax(vDates,vSM);