don't create new dimension each switch
don't create new dimension each switch

this doesn't help with performance, but it's the rare example where
you want to keep a dimension and use the group key function
(not used very often)

also use the declared variable, don't create an accidental global :-o

fixes #1577

dc-js/dc.js,dc-js/dc.js,dc-js/dc.js,dc-js/dc.js,dc-js/dc.js