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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
EliGohar
Partner - Specialist
Partner - Specialist

Check if specific date is between a range in a previous row

Hi

I want to create an indicator for the following scenario:

If "Start Time" value is between a range in the previous row (Range = Start Time to End Time) then I want to mark this record with value "1".

For example, look at ObjectID 3796578:

image.png

It's start time is on 22/12/2019 8:27:10, which is between the previous row range ( 22/12/2019 8:27:00 -  22/12/2019 8:27:14)

How this can be done within the script?

Thanks.

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi 

assuming your table is sorted in the right order 

than you should be able to use something like this 

if([Start Time] >= previous([Start Time]) and [Start Time] <= previous([End Time]),1,0) as Flag

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

hi 

assuming your table is sorted in the right order 

than you should be able to use something like this 

if([Start Time] >= previous([Start Time]) and [Start Time] <= previous([End Time]),1,0) as Flag

EliGohar
Partner - Specialist
Partner - Specialist
Author

Thanks!!!  @lironbaram