PRD-5182 - Added capability to perform automatic sorting based on grouping arguments