Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Compare Time between date and stored time in variable

Hello Friends,
I want to compare time between time of date and time in variable. But in calculation if always gives me wrong result.
please see below example.
Ex.
DT1Time of DT1Variable (p_time = '10:30')

Expected Result

Calculation

=If((time(DT1,'hh:mm') <= p_time), '1','0')

27/05/2013 08:00:0008:0010:3010
24/05/2013 08:30:0008:3010:3010
24/05/2013 09:00:0009:0010:3010
26/05/2013 10:40:0010:4010:3000
26/05/2013 11:00:0011:0010:3000
here in this example according to formula my result should be "Expected Result" but it always give me wrong  result.
I have attached this examle file as well.
Please help me to identify the problem.
Thanks
1 Solution

Accepted Solutions
Sokkorn
Master
Master

Hi dipak.nit,

1. Change your variable: p_time = Interval('10:00','hh:mm')

2. Compare expression should be like this

=If(Interval#(Time(DT1,'hh:mm'),'hh:mm') <= p_time, '1','0')

Regards,

Sokkorn

View solution in original post

3 Replies
Sokkorn
Master
Master

Hi dipak.nit,

1. Change your variable: p_time = Interval('10:00','hh:mm')

2. Compare expression should be like this

=If(Interval#(Time(DT1,'hh:mm'),'hh:mm') <= p_time, '1','0')

Regards,

Sokkorn

Not applicable
Author

Hi Sokkorn,

It is working now.

Thank you.

Not applicable
Author

Hi b. Sokkorn,

It's also solve my problem (y)

Thank you.