At first glance this seemed like it would require a multi-step answer involving a temp table containing GROUPed results HAVING the total elasped time between MIN(entry_time) and MAX(exit_time) < 100 then UNIONing that to the original table LEFT JOINed to temp WHERE NULL, but then I realized your Gap wasn't the time spent on but the time spent away. So...
If I understand the question correctly, this ought to do the trick:
select min(entry_time), max(exit_time), id, location_id
from filter_table
group by id, location_id, case when gap < 100 then 0 else entry_time end
I tried to keep the SQL as generic as possible. The trick is in the CASE statement in the GROUP BY; it genericizes gaps < 100 thereby grouping them but keeps bigger gaps unique and ungrouped.
Round 2 - Adding a Windowing Function
Turns out, we need to expand on the first solution (see comments).
select min(a.entry_time), max(a.exit_time), a.id, a.location_id
from
(select *, sum(Final_group) over (order by row_num rows unbounded preceding) as running_total
from filter_table
) a
group by a.id, a.location_id, case when a.gap < 100 then 0 else entry_time end, a.running_total
By adding a windowing function in the new subquery, we can calculate a running total of Final_group and by grouping on that too, we can now distinguish between groups on either side of a gap > 100.
Round 3 - Use a Self Join Instead
I am reliably informed that MonetDB does not support windowing functions. So let's rewrite the subquery to use an old-school self join to get the running total:
select min(a.entry_time), max(a.exit_time), a.id, a.location_id
from
(select t1.entry_time, t1.exit_time, t1.id, t1.location_id. t1.gap,
sum(t2.Final_group) as running_total
from filter_table t1
inner join filter_table t2 on t2.row_num <= t1.row_num
group by t1.entry_time, t1.exit_time, t1.id, t1.location_id. t1.gap
) a
group by a.id, a.location_id, case when a.gap < 100 then 0 else entry_time end, a.running_total
Lastly - Moved the Case statement
Monet doesn't like the Case statement in the Where clause either, So:
select min(a.entry_time), max(a.exit_time), a.id, a.location_id
from
(select t1.entry_time, t1.exit_time, t1.id, t1.location_id. t1.gap,
sum(t2.Final_group) as running_total,
case when t1.gap < 100 then 0 else t1.entry_time end as case_gap
from filter_table t1
inner join filter_table t2 on t2.row_num <= t1.row_num
group by t1.entry_time, t1.exit_time, t1.id, t1.location_id. t1.gap
) a
group by a.id, a.location_id, a.case_gap, a.running_total
I hope this helps