Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

time check

Hello

I got a qvw document on which I created a task for scheduling reload

how can I check if the script is running before or after 12:00AM after midnight?

there is a variable declared in the document whose value depends on whether the reload is carried on before midnight or after midnight

how can I make this time check?

please advise

I can walk on water when it freezes
9 Replies
christophebrault
Specialist
Specialist

hi,

The function =Realoadtime() will give you the date and time for the last reload of your document.

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
ali_hijazi
Partner - Master II
Partner - Master II
Author

so?

I can walk on water when it freezes
christophebrault
Specialist
Specialist

So compare the time obtained by Reloadtime() with 12:00:00 in your condition.

Perhaps i'm not understanding very well what you want to do...

Put an exemple of what you need ?

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
ali_hijazi
Partner - Master II
Partner - Master II
Author

okay

how to compare reloadtime() with 12:00AM

what is the function? is it reloadtime() - 12:00Am sure not

I can walk on water when it freezes
Miguel_Angel_Baeyens

Hi,

You can use the Interval() function and Time()

=Interval(Time('00:00') - Time(Frac(ReloadTime())))

That will return, for example, "-01:00:00" (hh:mm:ss) if ReloadTime() (when reload finished) is 1 AM.

Hope that helps.

Miguel

christophebrault
Specialist
Specialist

in your variable, try :

=if(time(reloadtime())>maketime(12,00,00),'your value','your other value')

With this expression, you can affect a different value to your variable depending on the time your document was reloaded, before or after 12:00.

Look the example

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Not applicable

maybe this:

=  ' Last Reloaded on:    ' & ReloadTime()

you can create a text object and add this to the "text"

ali_hijazi
Partner - Master II
Partner - Master II
Author

isn't there a method that returns a number upon comparison?

so that I check if the returned number is positive or negative?

I can walk on water when it freezes
Miguel_Angel_Baeyens

Hi,

Actually that's what Interval() does. You can use an If() conditional to check whether it is positive or negative.

Regards.

Miguel