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

Calculating time interval using current time

Hey guys,

I have a requirement to take a time interval of a set daily cutoff time and the the current day's time.  I have loaded the cutoff timestamp in the time([cutoff time]) format. 


What I want to do is write an if statement if the current time passes the cutoff time to display a status i.e. 'Incomplete'/'Complete'.

My problem is that when I write out my condition =if([Allocation Cutoff] < time(now()), 'Complete', 'Test') my output is 'Complete' for all times regardless of whether or not the current time greater than the cutoff time.  When I hard code a time of '4:00 PM' the condition works fine, but it seems time(now()) or any version of that - time(today()), time(localtime()) doesn't seem to recognize the relationship correctly in the condition.  I have even loaded a getdate() timestamp from my SQL load.

Is there another function/method I should be using correctly establish this relationship between cutoff time and the current time?

1 Reply
sushil353
Master II
Master II

hi,

Try the match the data format in the comparison.. the best way is write your expression both side one by one in text box..

There you will find the format that your function is returning .. use date function to correct the format...

HTH

Sushil