How to check whether points started in red and ended in a blue polygon (and vice versa) while sharing the same attribute?
To check if the first location of the unique ID is in one polygon and last in another.
You can achieve this using a virtual layer.
It would identify the 1st and last point for each category, then intersects these points with the polygons. It further ensure the polygons have the desired set of property (red, blue in your question) and at last that the 2 polygons do not have the same property. This last step is important should you have more than 2 possible values.
go to the menu
Layer > Add Layer > Add/Edit Virtual Layer... and enter the following query
select * from ( select id_easy, min(ordinal) minordinal, max(ordinal) maxordinal from test group by id_easy ) as minmax JOIN test t1 on (minmax.id_easy= t1.id_easyand minmax.minordinal = t1.ordinal) JOIN poly p1 on st_intersects(t1.geometry, p1.geometry) AND p1.field_a in ('blue','red') JOIN test t2 on (minmax.id_easy=t2.id_easyand minmax.maxordinal = t2.ordinal) JOIN poly p2 on st_intersects(t2.geometry, p2.geometry) AND p2.field_a in ('blue','red') WHERE p1.field_a != p2.field_a