Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I am new to qlikview
I wanted to List the errors in the dashboard, so I chose textboxt to display them.
firstly I used "ScriptErrorList" error variable with the following if statement in the textbox,
if(ScriptErrorCount>0, ScriptErrorList , 0)
it gave the proper output, but it just gave the output like "syntax error" or "general error" not the detailed one.
so, I am using "ScriptErrorDetails" error variable for detailed error list but nothing is displayed in the textbox.
Following is the statement which I wrote in the textbox for getting the detailed error list :-
if(ScriptErrorCount>0, ScriptErrorDetails, 0)
0 is displayed when no error is there in the script, but nothing is displayed when there is error in script.
Please tell me how to use ScriptErrorDetails in qlikview
Thanks In advance
Hi IIiyan Somle
It seems this code will work for me. Let me try it. Will let you know
Thanks in advance.
Bhumika
Hello IIiyan
Code is working absolutely fine. Thanks for help.
but I have a doubt, That if there is two consecutive errors then it will give error details for the last error, not for the first one. For eg.
Errors:
LOAD ErrorCode, Errors
FROM
(txt, codepage is 1251, embedded labels, delimiter is ' ', msq);
//this will create table to keep the info about the last error that has occurred
LOAD a as yy,
yy
FROM
(ooxml, embedded labels, table is Sheet1);
ErrorDetailTable:
LOAD ApplyMap('MapErrors','$(ScriptError)') as ErrorType,
'$(ScriptErrorDetails)' as ErrorDetails
AutoGenerate(1);
Here, I have added a Load statement to your code where I have given same column names.
So, it is giving errordetail only for last load i.e "Field names must be unique within table".
What do you suggest? Adding For loop in this case will help or should I go for different approach?
Thanks
Bhumika
Hi Bhumika,
You are right and it is as I wrote to you originally - it gives errordetail only for the last error. So I suggested copy-pasting the small code after every block of code (every LOAD statement - where you have a little hammer symbol on the left of your code). The information will automatically concatenate in just one table in the end.
I know this is not a lean solution. I tried to make a 'sub ...end sub' code and Call it after each block of code but for some reason it didn't work well. Maybe you will find a better solution to this.
Also if you have 2 or 3 error in a block of code QV stops at the first error found and will return information/details only about this error, which is natural in most cases.
Hope this helps you somehow,
Iliyan
You are correct that a sub won't catch the error. The error state will be reset by the Call statement. Better to use a $include that contains your error recording code after each load.
Rob
ok.. Thanks IIiyan
I will try what you have suggested and let you know if I get a proper output.
Thanks
bhumika
Thanks rob for the suggestion.. I will try and let you know.
Thanks
Bhumika