Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

When Source file not present than Qlikview should throw an error and reload get failed

Hi All,

Need an urgent help in the below scenario. Here is the scenario:

We have to load total of four source file into Qlikview for every month and store it into a monthly QVD.

We are loading the file and storing the data in monthly QVD by using the ‘MonthYear’ column in the source file.

For example:

  • à Let us say we are in the month of DEC 2016 and we have receive the source file for NOV 2016.

File name could be file1.txt, file2.txt, file3.txt and file4.txt

Every month source will be replaced with new file.

So we will load all the file and based on the MonthYear column and Qlikview will create QVD.

Final QVD will be file1_112016.QVD, file2_112016.QVD, file3_112016.QVD and file4_112016.QVD

  • Now let us assume we are in JAN 2017 and we have receive the source file for DEC 2016. But due to some error in source file scheduler program only two source file out of four source file got updated.
  1. i.e. Suppose only file1.txt and file2.txt got updated and other two files are not updated.

Again the File name could be file1.txt, file2.txt, file3.txt and file4.txt (All the month file name will be same.)

Now we want the Qlikview to generate QVD only when all the files are updated otherwise it should through error.

How to achieve this??? Please Help!!! Any help is much appreciated.



Regards

Deepak

1 Reply
Gysbert_Wassenaar

Use a loop to run through the files:

  For each vFileName in 'file1.txt', 'file2.txt', 'file3.txt', 'file4.txt'

      Load *,

        '$(vFileName)' as FileName

      From [$(vFileName)];

  Next vFileName


When one file does not exist the load will fail.


NOTE: Change the code inside the loop to make sure it does what you need. The code above is just an example of the loop.


talk is cheap, supply exceeds demand