Set up atleast 3 ini files named something like mame-0, mame-1, mame-2.
I have them for All games, Filtered, Favorites. If you want more lists for sports, platformers, fighters....etc, then make more files along the convention of mame-3, mame-4, mame-5.
You need a file for every list you want to make. These must be named the same as your ini file for that emulator. In this case, you'd have an ini file named mame.
Make sure to link the pathway to your catver.ini file in your mame.ini as it specifies. Without that file you cannot sort by categories.