Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
EliGohar
Partner - Creator III
Partner - Creator III

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 - Creator III
Partner - Creator III
Author

Thanks!!!  @lironbaram