Allow RANK grouping variables to be strings. Fixes bug #18533.