Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Top 5

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.

1 Solution

Accepted Solutions
Highlighted

Kind of similar question. Check the below link.

Latest 3 Records

View solution in original post

12 Replies
Highlighted

Kind of similar question. Check the below link.

Latest 3 Records

View solution in original post

Highlighted
Not applicable

Hi Nagraj,

i am not getting correct output.

please give example with my files.

Highlighted
Specialist
Specialist

Hi Nagraj,

i am not getting jan3,jan4,jan5 files data

please share  the example with my files

Highlighted

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.

Highlighted
Not applicable

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

Highlighted
Not applicable

Hi QV,

Did you try my solution? Can you please try it and let me know is it fine?

Thanks,
Sreeman

Highlighted
Specialist
Specialist

Hi,

i am not getting correct output. i will attach my files can you try with myfiles

Highlighted

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)...?

Highlighted
Not applicable

Hi Mahesh,

sure. please attach the files so that I will try it.

Thanks,
Sreeman