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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
buederbenjamin
Partner - Contributor III
Partner - Contributor III

Script Line error

Hi everyone,

I want to call a sub routine in my script. When the "call" statement is include in a IF, the script works correctly but when it's called as an independent instruction I get this error message: "Script Line Error".

Does anyone have an idea?

Thanks a lot,

3 Replies
vishsaggi
Champion III
Champion III

Can you share some more information here please. Like a snapshot of your error and the subroutine you are using ?

buederbenjamin
Partner - Contributor III
Partner - Contributor III
Author

Thank you Vishwarath,

here is my sub routine:

SUB Purge_Load_Status 

  Load_Status_Max_Year:

  Load

  Max(Year(Load_Date)) as MaxYearLoadStatus

  From [$(_File_Load_Status)](qvd);

  let maxDateLoadStatus = peek('MaxYearLoadStatus', 0, 'Load_Status_Max_Year'); //MaxDate chargée

  Drop table Load_Status_Max_Year;

  NoConcatenate

  Load_Status:

  Load *

  From [$(_File_Load_Status)](qvd)

  Where Year(Load_Date)>=($(maxDateLoadStatus)-2);

  Store Load_Status into [$(_File_Load_Status)](qvd);

END SUB

vishsaggi
Champion III
Champion III

Any specific reason you need a subroutine here? Cant you just run the LOAD as is. However, where is the IF you are using here? I dont find anything wrong with the LOAD script. Can we know what exactly you were trying to achieve ?