Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist II
Specialist II

Transform ScriptErrorDetails Into a usable Text

Hi,

I'm trying to transform ScriptErrorDetails  in a String to Insert into a csv file.

This variable has a single quote in the middle of a message, so if a Purge them I can't transform in a string and if I don't I can't transforme either.

Input from ScriptErrorDetails variable: 'Field 'CPF\CNPJ'not found'

Code:

Let vError= PurgeChar(($(#ScriptError)&';'&ScriptErrorDetails), chr(39));
Let vError_code= SubField(vError,';',1);
Let vDetail= Text(SubField(vError,';',2));
Let MyMessage =$(vDetail);  //  Field CPF\CNPJ not found

Error: UnexpectedToken CPF/CNPJ

Any idea how to transform all this in a string?

Thank you

Labels (1)
1 Solution

Accepted Solutions
Highlighted
Specialist II
Specialist II

Hi,

I solved purgin the single and double quote and after adding a double quote.

 

Let vError=($(#ScriptError)&';'&ScriptErrorDetails);
Let vError_code= SubField(vError,';',1);
Let vDetail= chr(34)&PurgeChar('$(vError)',chr(39)&123456789&';'&chr(34))&chr(34);

View solution in original post

3 Replies
Highlighted
MVP & Luminary
MVP & Luminary

I believe you need to quote ScriptErrorDetails

'$(ScriptErrorDetails)'

So

'$(#ScriptError)'&';'&'$(ScriptErrorDetails)' as Error

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Highlighted
Specialist II
Specialist II

Hi Rob,

The Output of a ScriptErrorDetails i need to put into a variable and not a field, so I can't use as Error, but i tried to put this result into a variable and the error persist.

Let vError= '$(#ScriptError)'&';'&'$(ScriptErrorDetails)';

 

image.png

Highlighted
Specialist II
Specialist II

Hi,

I solved purgin the single and double quote and after adding a double quote.

 

Let vError=($(#ScriptError)&';'&ScriptErrorDetails);
Let vError_code= SubField(vError,';',1);
Let vDetail= chr(34)&PurgeChar('$(vError)',chr(39)&123456789&';'&chr(34))&chr(34);

View solution in original post