Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

To check the End of File

Hi,

Is there any way to check the end of file??

I have a requirement like, we have a list of folders and inside each folder a text file will be there whose name is same in all the folders.

So I need to take data from those text files to Qlikview. Now I can fetch data from the text files but I need to have a field or a value to identify the end of each file.

I will be using that filed or value in an another table to check whether It came from same file or from a different file.

Is there any way to do this??

Thanks in advance.

Regards,

Leni Balakrishnan

18 Replies
Anonymous
Not applicable
Author

The above load statement will give the min and max time of each file??

Gysbert_Wassenaar

Yes. Try it out with a single file first to see what happens.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

ok

Anonymous
Not applicable
Author

It gives the max & min time by considering all data together and not for each file.

Gysbert_Wassenaar

If you load your files in a loop then you should be able to get the min and max per file loaded. Can you post the script?


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Hi,

Sorry for the late reply.

Actually It gave the min and max value of each file. I did a mistake so it considered min & max of all data together.

Now its working fine.

But with this how can I achieve my requirement??

Gysbert_Wassenaar

If you have all the log data in one table and the start and end times in another, then you can join the two tables and have all the data together.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

But in my requirement,

I have to take start time and endtime from same file as well as from different file.

Actually I am using the log file generated by the application for the appln currently I m working.

Using that I am calculating the time taken for each qvd to create. So I am taking the starttime as the previous store statements time and Endtime as Current store statement time. Like below:

12:00:01 tb1:

12:00:01 load* from xx.file;

12:00:01 store tb1 into file.qvd; => StartTime

12:00:01 tb1:

12:00:02 load* from xx.file;

12:00:02 store tb1 into file.qvd; => EndTime

So while taking like this from each file, I m getting a problem like the first log file finished its execution @ 11 PM and the 2nd log file (which might be of another days log file) starts at @ 4 AM so as per my logic it ll give a wierd answer. So I have a checkpoint like

if(FilePath = Previous(FilePath),Previous(StartTime), StartTime)

so here if the current file path is same as previous file path then the data is coming from same file so I m taking the previous time. If tat is not the case I m taking the current time.

To do this now I m using FileDir() but is there any other way to achieve this???

Thanks

Not applicable
Author

test