Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

Timer in QlikView

Hi All,

I'm using timer in the qlikview...

I just want to convey message to user at the particular time...

=If( (Time#(Now())>Time#('11:00:00', 'hh:mm:ss')) and (Time#(Now())<Time#('16:00:00', 'hh:mm:ss')) , 'Peak Time', Time#(Now()))

Somehow the above condition is not fetching the message.

Any help is highly appreciated!

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=If(Num(Frac(Now())) > Num(Time#('11', 'hh')) and Num(Frac(Now()))< Num(Time#('16', 'hh')), 'Peak Time', Time(Now()))

View solution in original post

5 Replies
sunny_talwar

Try this:

=If(Num(Frac(Now())) > Num(Time#('11', 'hh')) and Num(Frac(Now()))< Num(Time#('16', 'hh')), 'Peak Time', Time(Now()))

markgraham123
Specialist
Specialist
Author

Sunny,

Can i please know Num(Frac(Now())) functionality....

When i tried that function separately it's throwing decimal value.

sunny_talwar

Num() function include Date and Time and when you do a comparison just to the time you are basically comparing 42418.678.... to a very small decimal number 0.45833333 or 0.666667. By doing frac, I remove the 42418 part and do the comparison of just the time component:

0.678... > 0.45833333 and 0.678 < 0.666667

instead of

42418.678 > 0.4583333 and 42418.678 < 0.666667 which will always be false

Does that make sense?

markgraham123
Specialist
Specialist
Author

Got it!

Thanks a lot friend

sunny_talwar

No problem at all