How to group results by multiple fields?
In D7 - you can achieve your grouping structure in Views with the help of the Views Merge Rows module.

You'd use the option "Use values of this field as a filter" for the field that produces x &amp; y. And for the file name field you'd use the option "Merge unique values of this field".