Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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);
I believe you need to quote ScriptErrorDetails
'$(ScriptErrorDetails)'
So
'$(#ScriptError)'&';'&'$(ScriptErrorDetails)' as Error
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
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)';
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);