Natively, the function of Anaplan doesn't do that. However we can achieve it easily enough.
you can rank by type, which is what I did in "Rank within Groups" with this formula:
RANK(profit, DESCENDING, SEQUENTIAL, TRUE, type)
So logically what we need to do it to add to the ranking within the type the max value of the previous types.
You'll need a system module for the next steps, like this:
Max rank = getting the highest rank of each type = 'forum: rank by group'.Rank Within Groups[MAX: 'forum: rank by group'.type]
Priority = you get it
Value to add = cumulating the max value of the previous groups = RANKCUMULATE(Max Rank, Priority, ASCENDING, TRUE)
Previous Type = just set the previous type in terms of priority so that we can bring the previous type's value to add
Now if you go back to the original module, a few more line items:
previous type = we cannot do a double depth lookup so we need to bring the "previous type" at this level = 'forum: type ranking'.Previous Type[LOOKUP: type]
Final Ranking= 'forum: type ranking'.Value to Add[LOOKUP: previous type] + Rank Within Groups
To be noted that the priority and previous type inputs can be fully automated by just using the order of the items in the list and FINDITEM if there was a longer list. Didn't go into it not to confuse.