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: 
rupaliqlik
Partner - Creator
Partner - Creator

script failed and their reason should capture

Hi experts,

          I have a requirement where I will load all server logs like (qvd extractor document logs).If my script execution is failed then I wil create flag Script_Failed ='Y' else N.If flag Y then I want to fetch the error like syantax error or anything .But if it is  succsful then null.

    Script failed       Header 2
Sctipt FailedError
Ysysntax error
N
YUnknown statement
N

Regards,

Rupali Ethape.

kaushik.solankistalwar1hicvatr841029

4 Replies
tresesco
MVP
MVP

You could try like:

Set ErrorMode=0;


<Your Script here>

Load

          If(Len('$(ScriptError)')=0, 'N', 'Y') as [Script failed],

          '$(ScriptError)' as Header2

AutoGenerate 1 ;

rupaliqlik
Partner - Creator
Partner - Creator
Author

Hi Tresesco B ,


          My main concern is that how to load log file and captur error .I want to write a script.How to write a script to capture error flag?

Anil_Babu_Samineni

Difficult to load your log files into Qlik platform. Instead, We have tools to understand where that error occurs. Moreover, We can skip that error using SET ErrorMode = 0

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The free Script Log Analyzer tool

Qlikview Cookbook: Script Log Analyzer http://qlikviewcookbook.com/recipes/download-info/script-log-analyzer/

loads logs and flags those that are failing.  You could use that as a base, Should be easy enough to update to capture some error reasons by looking for "Error:" in the script text.

You might also consider a different approach and read the C:\ProgramData\QlikTech\DistributionService\TaskResults files instead.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com