In the following expression, station_timestamp is a timestamp (!) and station_color is a hexadecimal color code (generated during load) and both come from the same table. The variable vActualTimestamp is the maximal timestamp (closest to the actual time) at which data is retrieved, and is simply max(station_timestamp).
The expression works as expected and when I click a point on the map, the color expression also works without a problem. However, when I click data in a table (that is linked to the map), the point color becomes gray. I suspect it would work if I could manage to rewrite the expression with set analysis. I've tried a couple of things but I don't seem to make it work. How should I do it?
For the expression to work, I also had to add in the field of the layer =if(station_timestamp = vActualTimestamp, station_id) to show points and attributes. station_id is a field from the same table as station_timestamp and station_color but also links this table to 2 other tables.