Yearwise sort a block of texts

I am using Ubuntu 22.04 and LibreOffice Version: 25.2.1.2

I have a document file with blocks. Previously with the help of asklibreoffice and @KamilLanda I managed to extract the blocks containing a phrase in the table. Now the phrase actually is a Year in the block but outside the table. I wish the blocks should be extracted by sorting the case number yearwise. The file is attached herewith.
Exp.odt (41.8 KB)

So is the criterion for sorting the red marked numbers?

I would assume the intended order is as shown in the attached .ods.
I’m not sufficiently familiar with Writer to suggest a method for extracting the related text parts and re-joining them sorted.
(Yes. I would use a helper sheet created by the routine for sorting. Such helpers are cheap in monolithic LibreOffice.)
disask119477_Exp.ods (23.5 KB)

Always post the link in such a case!

Yes, Only year is enough. But if we can sort with the case number it is well and good.

The example sheet I attached uses the SORTBY() function which was introduced with
V 24.8. You won’t see the results with your versions therefore.
However, in an automatically created helper sheet the sorting could also be done “in situ” using a SortDescriptor.