Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
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
Honored Contributor II

Re: Calculating time interval using current time


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...