It won't work as you expected since the dollar sign expansion $(=dimensionality()) will be performed even before the expression will be parsed and evaluated. So it has in fact nothing to do with the abilities of set analysis (though it's true that set analysis does not consider chart dimensions, but is evaluated once).