diff --git a/src/output/ods/proteinsheet.cpp b/src/output/ods/proteinsheet.cpp
index 5a67f8ef9b5f3a65d2ddf5e739c5a5b86f78af59..70fc14d52dc9e2f845dfa35bcca583a9dfd809e5 100644
--- a/src/output/ods/proteinsheet.cpp
+++ b/src/output/ods/proteinsheet.cpp
@@ -143,8 +143,8 @@ ProteinSheet::writeIdentificationGroup(IdentificationGroup *p_ident)
 
       std::sort(protein_match_list.begin(), protein_match_list.end(),
                 [](const ProteinMatch *a, const ProteinMatch *b) {
-                  return a->getGrpProteinSp().get()->getSubGroupNumber() <
-                         b->getGrpProteinSp().get()->getSubGroupNumber();
+                  return a->getGrpProteinSp().get()->getGroupingId() <
+                         b->getGrpProteinSp().get()->getGroupingId();
                 });
 
       for(auto &protein_match : protein_match_list)