Today a user asked how to show the top 2 values for each bygroup in a VA object on the VA community.
We don't seem to have a good way to do this in VA. It seems like it would be a logical feature to add a "Context" option on the rank definition on the Ranks pane to let you switch between the ByGroup and ForAll contexts, similar to the _ByGroup_ | _ForAll_ context we specify for aggregations in the expression editor.
For example, if we have this crosstab:
![rankby.png rankby.png](https://communities.sas.com/t5/image/serverpage/image-id/73407i7D54E9CFF8A5E740/image-size/large?v=v2&px=999)
We could make a ranking on Model that would return the top two models for each Type category:
![rankby1.png rankby1.png](https://communities.sas.com/t5/image/serverpage/image-id/73411iDDA8ED1F9105FE96/image-size/large?v=v2&px=999)
Currently I believe this can only be achieved with by precalculating the rank.