A relationship to the latest referencing entity in views I am not quite sure how to do this. I have content type A and another content type B which references content type A using an entity reference field. So A can have multiple nodes of type B referencing it. Not B has a date field.

Now what I want to do is create a view that lists content of type A but sorted based on the date field of the latest node of type B that references it.

I am not really sure what is the best way to achieve that. Any help is highly appreciated.
Make a view that lists nodes of Type B.
Sort this view based on date.
Add relationship based on the reference field which reference content type A.
Now list the fields you want from Content type A.
If you don't need fields from Content type B, hide them.