Sort list by count (occurance) or character count
Wondering how to sort a list by either occurrence count or character count.
I have:
- toppfs = LP_inventory_form[AUCTION_TITLE_ROOT = input.AUCTION_TITLE_ROOT].Pressing_features.getAll().distinct();
- toppfs.sort(true);
- input.Pressing_features:ui.add(toppfs);
This sorts my list alphabetically of course. But I want to sort by:
A) Count of instances each element in toppfs occurs when AUCTION_TITLE_ROOT = input.AUCTION_TITLE_ROOT
or
B) By the character count of each element in toppfs