group_dimension_instances function

Group instances of a dimension