Please refer to the Stock count function help for more information and examples on how to use grouping criteria.