Given you are using MS Access.
You can achieve the output by writing 2 querries...
1. query with the distinct filename
2. using crosstab with the filename col and AKA code being transposed
You can then inner joined the 2 querries on filename.
Thank you and Hope this helps...
Koncentrix