Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

compare time

I have a list of time and want to know if they are in the future or past compare to now.

16-07-2018 10-31-29.png

so expecting to see:

16-07-2018 10-33-18.png

any idea, I tied to play with the interval function but not sucess yet...

Thanks

Raphael

LOAD * INLINE [

    MyTime

    01:00

    05:00

    10:00

    15:00

    20:00

];

1 Solution

Accepted Solutions
sergio0592
Specialist III
Specialist III

Hi,

Use as expression :

if(time#(MyTime,'HH:MM:SS')<time(Now()),'Past','Future')

See the attached .qvw.

Regards

View solution in original post

4 Replies
sergio0592
Specialist III
Specialist III

Hi,

Use as expression :

if(time#(MyTime,'HH:MM:SS')<time(Now()),'Past','Future')

See the attached .qvw.

Regards

tresesco
MVP
MVP

Try:

If(MyTime>=Frac(Now()), 'Future', 'Past')

Anonymous
Not applicable
Author

Many thanks!

thevingo
Creator
Creator

Hi

I know its already answered, but the solution doesn't work for me. My solution is:

Load *, If(Diff>0, 'Future', 'Past') as Flag_TIME;

Load *, Num(MyTime)-num(Time(Now())) + Num(Today()) as Diff, Time(Now()) as Now;

LOAD * INLINE [

    MyTime

    01:00

    05:00

    10:00

    15:00

    20:00

];

The result is

Capture.PNG