Query that checks the last record
The solution I gave you was based on the information you shared here. For example, you wanted a filter IDCommon= 'X'. Now your picture mentions Class::x(), but you've never told us anything about it, therefore it's not something I could consider. I suggest you start with the fixed value, test the overall approach and complicate the design later.
Yes, FirstOnly can give you the last record. Which record is the first or the last is just a question of sorting. Do it on the root data source (and test it; I said that I merely assume that it'll work).
Question: then i should put my view as a datasource in the query?
Answer: Correct. It's already covered in my previous reply.
Question: but joined with what?
Answer: If your view returns all the data you need, you don't need any join. But if you want fetch some data from other tables, you can. It's up to you.