conditionally allow primary dictionary sorting

the column of primary dictionarys can be sorted
only if they all have a valid entry (id) for all tests