Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

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
hrlinder
Honored Contributor

Re: Use Greater and less than function in Qlikview

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])

14 Replies
hrlinder
Honored Contributor

Re: Use Greater and less than function in Qlikview

try something like

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

instead of numbers 8,9 etc. use your timeformat

Re: Use Greater and less than function in Qlikview

what is format of IN_TIME & OUT_TIME

MVP
MVP

Re: Use Greater and less than function in Qlikview

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.

Not applicable

Re: Use Greater and less than function in Qlikview

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

Re: Use Greater and less than function in Qlikview

Hi All,

Please help me on this

hrlinder
Honored Contributor

Re: Use Greater and less than function in Qlikview

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

Re: Use Greater and less than function in Qlikview

Hi

not working..

hrlinder
Honored Contributor

Re: Use Greater and less than function in Qlikview

can you send example app?

MVP
MVP

Re: Use Greater and less than function in Qlikview

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')

Community Browser