Sort a array of hashes with one or multiple values