Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik community,
I'm having an issue on how to get ScriptErrorDetail. I know that it dissappear when i don't get it right after the error and here is my case :
I'm loading data from a file as shown below :
---------------------
$(vDIM_SPECIALITES_INFRA) :
LOAD AGENT_EMPLOI_REPERE,
INFRA_EMPLOI_REPERE_LIB,
AGENT_EMPLOI_REPERE_CODE_LIB,
INFRA_MATRICE_BUDGETAIRE,
INFRA_SPECIALITE_LIB,
INFRA_PRODUCTIONe
FROM [$(vFileSourcePath)$(vDIM_SPECIALITES_INFRA)] (qvd);
----------------------
After that i'm having this condition :
---------------------
if(ScriptError <> 0) then
// some code to store loadingStart/end, source file name, number of loaded rows AND the ErrorScriptDetails.
ELSE
// some other code
ENDIF;
--------------------
I need to keep the if condition to make condition if there is an error during loading and i also want to get the $(ErrorScriptDetails)
to store it into a log file.
Note that i'm having about 31 loads like the code shown above.
If anyone could helps it would be awesome.
ManyThanks
I resolved my issue by doing this :
$(vDIM_SPECIALITES_INFRA) :
LOAD AGENT_EMPLOI_REPERE,
INFRA_EMPLOI_REPERE_LIB,
AGENT_EMPLOI_REPERE_CODE_LIB,
INFRA_MATRICE_BUDGETAIRE,
INFRA_SPECIALITE_LIB,
INFRA_PRODUCTIONe
FROM [$(vFileSourcePath)$(vDIM_SPECIALITES_INFRA)] (qvd);
erreur:
Load * Inline ['ScriptError','ScriptErrorDetails'
$(ScriptError), $(ScriptErrorDetails)];
Let vErreur = peek('ScriptError',0,'erreur');
Let vMessage = peek('ScriptErrorDetails',0,'erreur');
And then i used my if condition.
Thanks everyone for your help.
Do this immediately after the LOAD:
Let vScriptError = ScriptError;
Let vScriptErrorDetails = ScriptErrorDetails;
Then use the variables for further processing.
Hi Jonathan,
Thanks for answering. Actually, if i declare those two variables :
Let vScriptError = ScriptError;
Let vScriptErrorDetails = ScriptErrorDetails;
I'll not get any value in vScriptErrorDetails because it should be declared right after the load. In my case i need to get those two values.
Hi Amine,
please check log file of the document
Settings-->Document Properties-->General Tab -->Right hand side you can see a Check box
Generate Log File from top 2 option.
if you check this automatically you can see the entire log file in a .txt format just you can open the log and find your issue easily
-->By default it's un-checked
-->.txt file will create where is your .qvw file is there(Same location)
if you feel you got solution for your issue,please close the thread by clicking "Correct Answer"
Hi Rama,
Thanks for sharing your knowledge. Actually, i need to personnalize the logging file that's why am not using the default one.
I resolved my issue by doing this :
$(vDIM_SPECIALITES_INFRA) :
LOAD AGENT_EMPLOI_REPERE,
INFRA_EMPLOI_REPERE_LIB,
AGENT_EMPLOI_REPERE_CODE_LIB,
INFRA_MATRICE_BUDGETAIRE,
INFRA_SPECIALITE_LIB,
INFRA_PRODUCTIONe
FROM [$(vFileSourcePath)$(vDIM_SPECIALITES_INFRA)] (qvd);
erreur:
Load * Inline ['ScriptError','ScriptErrorDetails'
$(ScriptError), $(ScriptErrorDetails)];
Let vErreur = peek('ScriptError',0,'erreur');
Let vMessage = peek('ScriptErrorDetails',0,'erreur');
And then i used my if condition.
Thanks everyone for your help.