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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

time range

I have the rawdata for surveys done at each clinic

there is a column for time where its written in this format "hh.mm.Ss"

and another table for time of survey for each clinic to be done for example.  10:00pm - 9:00 am. so the common between 2 tables is Location

how can i check if the survey is done between that time or not??????

1 Solution

Accepted Solutions
jagannalla
Partner - Specialist III
Partner - Specialist III

Hi,

How you are saying that  starttime 23:00 is yesterday's time. It can also be next day 23:00 time. We should have datetime in this case,then only you can achive your result.

For eg below one,KPHB result is expecting today's 23:00 time.

Clinic:

LOAD * INLINE [

    Clinic, Time, Location

    A, 09:00:00, Abids

    B, 08:34:45, Koti

    C, 10:43:56, Miyapur

    D, 12:12:12, Ameerpet

    E, 05:08:24, KPHB

];

Inner Join

LOAD * INLINE [

    Location, StartTime, EndTime

    Abids, 08:00, 10:00

    Koti, 09:00, 11:00

    Miyapur, 10:00, 12:00

    Ameerpet, 11:00, 12:00

    KPHB, 23:00, 06:00

];

 

ResiClinic:

LOAD Location, If(Time >= StartTime and Time <= EndTime,'T','F') as Flag Resident Clinic;

Hope it helps you

Cheers!!

Jagan

View solution in original post

4 Replies
er_mohit
Master II
Master II

try this, as per your time format,like this

time(fieldname,hh:mm:ss) as time_survey

on both fields. then you get right format

manideep78
Partner - Specialist
Partner - Specialist

Hi,

See attached qvw and let me know if there are any issues

Not applicable
Author

this is good but doesnt help when we have time range for 23:00:00 to 04:00:00

jagannalla
Partner - Specialist III
Partner - Specialist III

Hi,

How you are saying that  starttime 23:00 is yesterday's time. It can also be next day 23:00 time. We should have datetime in this case,then only you can achive your result.

For eg below one,KPHB result is expecting today's 23:00 time.

Clinic:

LOAD * INLINE [

    Clinic, Time, Location

    A, 09:00:00, Abids

    B, 08:34:45, Koti

    C, 10:43:56, Miyapur

    D, 12:12:12, Ameerpet

    E, 05:08:24, KPHB

];

Inner Join

LOAD * INLINE [

    Location, StartTime, EndTime

    Abids, 08:00, 10:00

    Koti, 09:00, 11:00

    Miyapur, 10:00, 12:00

    Ameerpet, 11:00, 12:00

    KPHB, 23:00, 06:00

];

 

ResiClinic:

LOAD Location, If(Time >= StartTime and Time <= EndTime,'T','F') as Flag Resident Clinic;

Hope it helps you

Cheers!!

Jagan