Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

In case data file cannot be uploaded in qlikview dashboard, an error should be raised and a log page should populate with data files details.

Hi Everyone,

I am having the excel source like Sample_03.22.2017AM and Sample_03.22.2017PM which will generated by daily basis.So I am pulling all the excel source by loading like Sample_*. xlsx.

In case any data file cannot be uploaded, an error should be raised and a log page should populate with the date and AM/PM missing data details.

How will achieve this? Can anyone assist me to get this done.

Thanks,

ShakilaD

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Thanks for the Update Massimo.

I have included the custom log instead of Trace.Its working fine.

Find the updated Script logic as below:

Generate the custom log for file missing.png

View solution in original post

4 Replies
maxgro
MVP
MVP

I think you have to loop on every file and check if the file exists, something like

vStart = Date(Today() - 10);          // start date

vNumOfDates = 10;                     // num of dates

// date loop

FOR i=1 to $(vNumOfDates)

  LET vDate = Date('$(vStart)' + $(i) - 1);

  //TRACE $(vDate);

  // AM PM loop

  FOR each ampm in 'AM', 'PM'

  LET vFile = 'Sample_' & Date('$(vDate)', 'MM.DD.YYYY') & '$(ampm)';

  TRACE $(vFile);

  IF FileSize('$(vFile)')>=0 THEN

       Log: LOAD 'File $(vFile) exists' as Msg AutoGenerate 1;

  ELSE

       Log: LOAD 'File $(vFile) does not exist' as Msg AutoGenerate 1;

  ENDIF

  NEXT

NEXT

1.png

Anonymous
Not applicable
Author

Thanks maxgro

But the script execution should terminate when the specific file not found.

Then in the log file should show the specific file not found error message?

Can you help me to do this?

maxgro
MVP
MVP

add an exit script, bold



vStart = Date(Today() - 10);          // start date

vNumOfDates = 10;                    // num of dates

// date loop

FOR i=1 to $(vNumOfDates)

  LET vDate = Date('$(vStart)' + $(i) - 1);

  //TRACE $(vDate);

  // AM PM loop

  FOR each ampm in 'AM', 'PM'

  LET vFile = 'Sample_' & Date('$(vDate)', 'MM.DD.YYYY') & '$(ampm)';

  TRACE $(vFile);

  IF FileSize('$(vFile)')>=0 THEN

      Log: LOAD 'File $(vFile) exists' as Msg AutoGenerate 1;

  ELSE

      Log: LOAD 'File $(vFile) does not exist' as Msg AutoGenerate 1;

      // add a trace if you want

    TRACE ..........................;

    exit script;

  ENDIF

  NEXT

NEXT

Anonymous
Not applicable
Author

Thanks for the Update Massimo.

I have included the custom log instead of Trace.Its working fine.

Find the updated Script logic as below:

Generate the custom log for file missing.png