Discussion Board for collaboration related to QlikView App Development.
i want to check before loading data in qvw if the file is on teh shared drive or not
so what is syntax of the if function in script and if not found give a pop up message
if file = true then ---------is this syntax corect as this is not working properly at my end like even if file is present or not it goes to "else statement"
load * from file
msgbox " file not present yet" --------is this syntax correct as this is not working and giving an error
I would suggest a message-free execution, by using
For each vFile in FileList('C.\path\Filename.csv')
Load * from [$(vFile)]
It is a loop, but if you do not use any wildcards in the mask (the parameter of FileList()), then it will be like an existence test.
thanks for the response but i am not able to implement in my script. let me give you more color..
i have 4 files with different names which i have defined in 4 different variables:
then i say
load * from file1
load * from file2
how can i write the above for loop in this scenario
You shouldn't use both ' and [ and quoting symbols. ' is enough.
For each vFileName in file1, file2, file3, file4
Load * from [$(vFileName)] ... ;
...or skip the Let statements altogether:
For each vFileName in 'y:\path\file.xls', 'y:\path\file1.xls', 'y:\path\file2.xls', 'y:\path\file3.xls'
...and skip the hard-coding:
For each vFileName in FileList('y:\path\*.xls')
the above syntax is helpful but not for this dashboard.
i want if anyone of 4 files are not present, it should exit the for loop.
the reason is i ran the above syntax and as files for today were not present it ran 4 times and popped up error message saying files not present.