Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sarfaraz_sheikh
Contributor III
Contributor III

Script Error

Dear All

I am getting below error while reloading the application.....however getting expected result /output  but below error is showing while reloading ...
ScriptError.png

I am using below script ...there is no error in the script as i believe..but above error is showing while reloading...

Break_Exceed_Report:

LOAD Date,  
     AgentName,
     AgentName&Date as KEYFORTEST,
     EventStartTime,
     EventType,
     Reason,
     EventDuration,
     Team,
     TL
    
FROM

(qvd);    
    
//FROM
//[\\10.62.211.141\hdfc_qlikview\DATA\TAT DATA\Break_Exceed_Report\Break_Exceed_Report.qvd]
//(qvd);   


concatenate

Load
     Date(Date,'DD-MM-YYYY') AS Date,
     AgentName&Date as KEYFORTEST,
     AgentName,
     EventStartTime,
     EventType,     
     Upper(Reason) AS Reason,
     Interval(Time(EventDuration),'hh:mm:ss') As EventDuration,
         
     //EventDuration,
     Team,
     TL
    
FROM

(ooxml, embedded labels, table is Sheet1)
WHERE NOT EXISTS(KEYFORTEST, AgentName&Date(Date,'DD-MM-YYYY'));

    
//FROM
//[\\10.62.211.141\hdfc_qlikview\DATA\TAT DATA\Break_Exceed_Report\BreakExeedReport.xlsx]
//(ooxml, embedded labels, table is Sheet1);

Store Break_Exceed_Report into 'E:\Qlikview\ERGO\Model_App\Sarfaraz\TAT Data\Break Exeed and Agent Not Ready Report\QVD Data\Break_Exceed_Report.qvd';

Logic:
Load

AgentName&Date as KEYFORTEST,

Interval(Time(Sum(if(WildMatch(Reason,'COMFORT','LUNCH','TEABREAK'),EventDuration))),'hh:mm:ss') AS EventDuration1

Resident Break_Exceed_Report

group by AgentName,Date;     
   
//   
//Logic1:
//
//LOAD
//
//EventDuration1
//
//resident Logic
//
//group by AgentName;
  


//Store Break_Exceed_Report into 'E:\Qlikview\ERGO\Model_App\Sarfaraz\TAT Data\Break Exeed and Agent Not Ready Report\QVD Data\Break_Exceed_Report.qvd';

//Store Break_Exceed_Report into '\\10.62.211.141\hdfc_qlikview\DATA\TAT DATA\Break_Exceed_Report\Break_Exceed_Report.qvd';

Regards

Sarfaraz

1 Solution

Accepted Solutions
puttemans
Specialist
Specialist

Hello,

I've encountered this several times, and believe me, there will be an 'else' somewhere in your script.

If you get the desired output, then it probably means that your script where Qlikview returns you an error for sits somewhere after the script you want to execute.

Are you sure you don't have any other sheets that are executed? The easiest way to check in case of some more complex scripting, is through the step by step debugger, or by opening the log-file and following the script there up to the error.

Regards,

johan

View solution in original post

7 Replies
Michiel_QV_Fan
Specialist
Specialist

Is the error because of this line:

'Interval(Time(Sum(if(WildMatch(Reason,'COMFORT','LUNCH','TEABREAK'),EventDuration))),'hh:mm:ss') A"


try to load without this statement to see if the error disappears. If so, adjust this statement as needed.


Consider to split this statement to different parts with load on load to make it easier to read / edit.

puttemans
Specialist
Specialist

Hello,

I've encountered this several times, and believe me, there will be an 'else' somewhere in your script.

If you get the desired output, then it probably means that your script where Qlikview returns you an error for sits somewhere after the script you want to execute.

Are you sure you don't have any other sheets that are executed? The easiest way to check in case of some more complex scripting, is through the step by step debugger, or by opening the log-file and following the script there up to the error.

Regards,

johan

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I suspect that you have an ELSE statement without an IF statement on another tab of the script. This can occur even if it happens after an Exit Script statement as QV tries to interpret all script tabs.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sarfaraz_sheikh
Contributor III
Contributor III
Author


Dear All,

You guys  are right ... i am using  if else statement in another TAB which was uncomment ...I made it as comment

Now the application is working fine as expected.

However one thing not understood i.e. if i say Exit script then why error is showing because my if else statemnt is defined after exit script ..

Regards

Sarfaraz

puttemans
Specialist
Specialist

My experience : exit script works on 1 tab, not on all tabs.

sarfaraz_sheikh
Contributor III
Contributor III
Author

Thanks Johan, I got it ...

Sarfaraz

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Exit Script is not necessarily the end of the code, so QV parses the code after the Exit Script as well. For example, consider this load script snippet:

     If vCount = 0 Then

          Exit Script;

     Else

          ... do something ...;

     End If

(maybe not the best structured programming style, but valid QV script syntax).

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein