Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
deborahs
Contributor III
Contributor III

Qlikview app to check if file exists before a specified time.

Hello!

I've made an app to check if a file exists in a folder and whether it was created before 615 am.

Does this code make sense?

I'm using vfileexists as a counter. I have a Nprinting app through which I'm trying to shoot a mail if the condition is not satisfied. Any help is appreciated! Thanks!

Code:

//To retrieve filename and load it in field filename

for each File in FileList('\\gmo\bosprod\CollineData\PACE\HOLDINGS\Working\*.csv')

File:

LOAD *, FileBaseName() as FileName

FROM [$(File)]

(txt, codepage is 1252, embedded labels, delimiter is spaces) ;

NEXT File

//To check if file was created before 6.16 am

let vFileExists = 0;

For each File in ('\\gmo\bosprod\CollineData\PACE\HOLDINGS\Working\*.csv')

when MakeTime(QvdCreateTime(FileName)<='(06,15)'

let vFileExists = 1;

exit for when $(vFileExists) = 1;

NEXT File

Labels (3)
1 Reply
Brett_Bleess
Former Employee
Former Employee

I have a potentially better solution for you:

http://help.qlik.com/en-US/qlikview/November2018/Subsystems/QMC/Content/QV_QMC/QMC_System_Supporting...

Scroll down to the File Exists section and have a look.  I do not think the triggers or dependencies are going to have any impact though, was thinking might be a way to tie things together with that, but maybe this can be the main trigger to things anyway, figured it was worth a shot.

The other option would be to simply create a PowerShell script instead of trying to run this as a macro in an app and use Publisher Support Task to run the PS script at the designated time...  That may actually be the better option now that I think about it.  You could have that task trigger whatever based upon the results of the PS script then...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.