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: 
Not applicable

Problem in storing ScriptErrorList to QVD

Hi,

I'm facing a problem right now where I need to log the errors that we're getting from our QVWs. I don't have any problem in storing the ScriptErrorCount and ScriptErrorDetails but having a problem on storing the ScriptErrorList to QVD.

The ScriptErrorList value look like this:

Field Not Found

General Error

General Error

Table Not Found

I try to store it using the following code:

LET vErrorDetail = ScriptErrorDetails;

LET vScriptErrorCount = ScriptErrorCount;

LET vErrorList = ScriptErrorList;

LET vErrorDate = Date(Now(),'YYYY-MM-DD hh:mm:ss');

LET vQVWName = DocumentName();

ErrorLogs:

LOAD '$(vQVWName)' AS [QVWName],

  '$(vScriptErrorCount)' AS [ErrorCount],

  Replace($(vErrorList),chr(10),chr(44)) AS [ErrorList],

  '$(vErrorDetail)' AS [ErrorDetail],

  '$(vErrorDate)' AS ErrorDate

AutoGenerate (1)

STORE ErrorLogs INTO QVWErrorLogs.qvd;

But the result in QVD looks like this:

QVWNameErrorCountErrorListErrorDetailErrorDate
QVWName.qvw4Field Not FoundTable not found2016-06-09 10:22:56

What I want to see is somewhat looks like this:

QVWNameErrorCountErrorListErrorDetailErrorDate
QVWName.qvw4Field Not Found, General Error, General Error, Table Not FoundTable not found2016-06-09 10:22:56

Any help would be greatlty appreciated.

Thanks

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will need '' around the $(vErrorList) and as Rakesh suggested, if your intent is to replace the newlines with commas, use

Replace('$(vErrorList)',chr(13)& chr(10),chr(44)) AS [ErrorList]

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

3 Replies
joris_lansdaal
Creator
Creator

logfile.PNG

why not generate a logfile and use that as input?

regards Joris

boorgura
Specialist
Specialist

Please try this:

replace(ScriptErrorList,chr(13) & chr(10), chr(44))

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will need '' around the $(vErrorList) and as Rakesh suggested, if your intent is to replace the newlines with commas, use

Replace('$(vErrorList)',chr(13)& chr(10),chr(44)) AS [ErrorList]

-Rob

http://masterssummit.com

http://qlikviewcookbook.com