Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
please find the attached files
I have files like
jan1
jan2
jan3
jan4
jan5
if i go for reload i need top 3 files data.
Expected output:-
jan5
jan4
jan3
for ex:- when I add jan6,jan7,jan8,
here i need jan6 to jan8 files data.
Kind of similar question. Check the below link.
Hi Nagraj,
i am not getting correct output.
please give example with my files.
Hi Nagraj,
i am not getting jan3,jan4,jan5 files data
please share the example with my files
Hello Manoj,
Is this your real file name.? How will you store the file for 2017, 2018 and so on..? If you want a dynamic code, you need to add year in the file name. (i.e Jan2_2015). Let me know.
Hi,
Could you please see the below script and it will get to the Top 3 values. Please let me know if you find any issue.
sub DoDir (Root)
for each File in filelist (Root&'\*.txt')
input:
Load '$(File)' as Name,
FileSize('$(File)') as Size,
FileTime('$(File)') as FileTime
AutoGenerate 1;
next File
end sub
call DoDir('D:\QlikView\community\214825')
NoConcatenate
input:
load Name, Size, FileTime Resident input Order By FileTime Desc;
For vFileNo=1 to NoOfRows('input')
Let vFileName = Peek('Name',vFileNo-1,'input_file');
Load *,
'$(vFileName)' as FileName
From [$(vFileName)];
EXIT for WHEN vFileNo='3';
NEXT
Thanks,
Sreeman
Hi QV,
Did you try my solution? Can you please try it and let me know is it fine?
Thanks,
Sreeman
Hi,
i am not getting correct output. i will attach my files can you try with myfiles
Mahesh,
I can give you the code which will work for your sample files. But my question is how will you save your future files (i.e 2017, 2018)...?
Hi Mahesh,
sure. please attach the files so that I will try it.
Thanks,
Sreeman