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: 
Not applicable

Issue Regarding Sleep Function

Dear All,

I am facing a issue while I am using Sleep Function in the Script.

If floor(today())=floor(WeekEnd(Today())) Then 

     SLEEP 5400*1000

ENDIF

ODBC CONNECT TO ***************************************************************************** ;

My reload starts at 5:45 AM that means when it will find Sunday it will sleep for 1 Hr and 30 Mins that means it will wake up at 7:15 AM but ENDIF executed at 6:45 AM that is exactly after 1 Hr. And i am observing this from past two weeks. earlier i was using 3600*1000 so in that condition it was fine but in current condition ENDIF should execute at 7:15 AM but it is not

1/6/2013 5:45:01 AM:      Execution started.

1/6/2013 5:45:01 AM: 0019  If floor(today())=floor(WeekEnd(Today())) Then

1/6/2013 5:45:01 AM: 0020    SLEEP 5400*1000

1/6/2013 6:45:01 AM: 0022  ENDIF

1/6/2013 6:45:01 AM: 0024  ODBC CONNECT**

Please help ............

Regrads,

Ankit Joshi

1 Solution

Accepted Solutions
flipside
Partner - Specialist II
Partner - Specialist II

1 hour appears to be the maximum period for Sleep ...

"The sleep statement pauses script execution for n milliseconds, where n is a positive integer no larger than 3600000 (i.e. 1 hour). The value may be an expression."

Try using two sleep commands 3600*1000 then 1800*1000.

flipside

View solution in original post

2 Replies
flipside
Partner - Specialist II
Partner - Specialist II

1 hour appears to be the maximum period for Sleep ...

"The sleep statement pauses script execution for n milliseconds, where n is a positive integer no larger than 3600000 (i.e. 1 hour). The value may be an expression."

Try using two sleep commands 3600*1000 then 1800*1000.

flipside

Not applicable
Author

Dear Flipside,

Thank you so much for your response. Initially I checked maximum value of Sleep that I found 24 days so I ignored the thought regarding 1 hour limit. After posting issue here I just tried the same logic what you have given n that worked fine.

Thanks.

Regards,

Ankit Joshi