Just thinking off the top of my head but you could try looking at using either the class() function or the valueloop() function as your dimension - look in the help file for details on both.
The valueloop() expression could be something along the lines of: