Discussion board where members can learn more about Qlik Sense App Development and Usage.
Is there a way to get the Max Date Modified in a folder. I have the following folder location:
In that folder I have a bunch of back files that look like this:
Name Date Modified
I would want to only return:
Is this possible? I have posted this in other places and tried it in other discussion groups but I could not get it to work.
Here is the code I used. I created a folder connection to Backups.
set vPath = 'Backups';
for each File in filelist ('Backups\backup_F_Gates_*.dist')
Load '$(File)' as Name,
num(FileTime('$(File)')) as FileTime
Load max(Filetime) as ModifiedTime
let vMaxTime = num(peek('ModifiedTime',0,'Modified_Time'));
if len(TableNumber('fileTable')) >= 1 then
rowno() as Recno
WHERE FileTime > '$(vMaxTime)'+0.001
ORDER BY FileTime desc;
Drop table fileTable;
Let VMxRows = NoOfRows('FinalTMP');
if $(VMxRows) >0 then
for i=0 to $(VMxRows)-1
let FileRead = peek('File',$(i),'FinalTMP');
FileName() as Filename,
FileTime() as FileTime
I tried to code but it is not working. There is a way I am sure to get it. Any help would be awesome.
Could you explain what you want to achieve with
rowno() as Recno
WHERE FileTime > '$(vMaxTime)'+0.001;
And with the code that follows that table?
I would have thought that a table load like
Timestamp(max(Filetime)) as ModifiedTime,
FirstSortedValue(Name, -Filetime) as LastModifiedFileName
should return your requested record.
That was code that someone had me try so I am not sure what it does. My goal is to get the latest or max date modified in a folder. If you look at the response above I have a folder called Backups.
each file in the folder has file with *backup and a date modified.
So the folder has 30 backup files and I want the file with the latest edition modified date.
Example of folder
*.backup01 Modified date 2/3/2016
*.backup02 Modifed date 5/16/1016
*.backup03 Modifed date 4/3/2016
*.backup04 Modifed date 3/16/2016
I want the response to return me *.backup02 only since it was the max modified date. I hope this makes since.