Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use Greater and less than function in Qlikview

Hi All,

I am trying to create a chart for employees come to time and go on time.

One of the tables have columns name , IN_TIME ,OUT_TIME, DELAY

I want to write a expression for employees who are coming between 8 AM to 9 AM  and going between 3 PM to 4 PM, They are coming on Time.

For IN_TIME >=8 and <=9 Comes early

OUT_TIME >=3 PM and 4 PM Going on time.

Please help me writing the expression and also assist me that which graph should i use for this.

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

for use in Expression you should provide a field only with timeformat

define in script:

time(IN_TIME,'hh:mm') as IN_TIME_H

time(OUT_TIME,'hh:mm') as OUT_TIME_H

then you can try the Expression

Count({<IN_TIME_H={">=$(=time('08:00'))<=$(=time('09:00')"},OUT_TIME_H={">=$(=time('15:00'))<=$(=time('16:00')"}>} [IN_TIME])

View solution in original post

14 Replies
Anonymous
Not applicable
Author

try something like

Count({<IN_TIME={'>=8<=9)'},OUT_TIME={'>=3<=4'}>}

instead of numbers 8,9 etc. use your timeformat

Kushal_Chawda

what is format of IN_TIME & OUT_TIME

jonathandienst
Partner - Champion III
Partner - Champion III

Are the IN_TIME and OUT_TIME fields normal QV time fields (numeric, between 0 and 1 in value)? If they are, then the expression could be:

If(IN_TIME >= Time#('08:00') And IN_TIME <= Time#('09:00'), 'Comes early') As EarlyFlag,

If(OUT_TIME >= Time#('15:00') And OUT_TIME <= Time#('16:00'), 'Comes early') As EarlyFlag,

Note that Time#(08:00) is equivalent to the value 8/24, formatted as a time.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi

I used the below expression but no output.

Count({<IN_TIME={">=1900-01-01 08:00:00.000<=1900-01-01 09:00:00.000"},OUT_IIME={"1900-01-01 15:00:00.000<=1900-01-01 16:00:00.000"}>} [IN_TIME])

I am using straight table.

It has 2 columns name , on_time

Time Format 1900-01-01 08:00:00.000

Please suggest

Not applicable
Author

Hi All,

Please help me on this

Anonymous
Not applicable
Author

for use in Expression you should provide a field only with timeformat

define in script:

time(IN_TIME,'hh:mm') as IN_TIME_H

time(OUT_TIME,'hh:mm') as OUT_TIME_H

then you can try the Expression

Count({<IN_TIME_H={">=$(=time('08:00'))<=$(=time('09:00')"},OUT_TIME_H={">=$(=time('15:00'))<=$(=time('16:00')"}>} [IN_TIME])

Not applicable
Author

Hi

not working..

Anonymous
Not applicable
Author

can you send example app?

jonathandienst
Partner - Champion III
Partner - Champion III

Those should be Time#() fucntions:

Count({<IN_TIME_H={">=$(=time#('08:00'))<=$(=time#('09:00')"},OUT_TIME_H={">=$(=time#('15:00'))<=$(=time#('16:00')"}>} [IN_TIME])


,,,and this assume a 24 hour clock.If you are using a 12 hour clock, then use

time#('03:00pm')


..or specify the format

time#('15:00', 'hh:mm') or time#('03:00pm', 'hh:mmtt')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein