Sort activitys in OLAP table like happypath

I want to sort a column that containins activitys according to the happypath. The activitys in that column that are not in the happypath can be ignored i.e. appended to the end. Is that possible?


I tried using the VARIANT function which gives me all the different variants but I dont see how I could do a group by to find out which is the most common.
Even if I could do that I would have a list of Strings (i.e. list of names of activities) which can not be used as a sorting criteria right?
I really doubt that what I am trying to do is impossible. Please confirm if you guys see it the same way.

Thanks and BR