Otuvy QM sorts names alphabetically (alphanumerically) throughout the system. This applies to service location names, sublocation names, section names, service names, area names, and other named records. Understanding how this sorting works will help you name your records in a way that keeps them organized and in the order you expect.
When Otuvy QM sorts a list of names, it compares each character from left to right, one character at a time. This is called lexicographic sorting, and it is the standard way that computers sort text.
This works intuitively for purely alphabetical names:
However, when numbers are part of a name, lexicographic sorting can produce results that feel out of order. That is because the system reads numbers as text characters rather than as quantities. It compares the first digit of each name first, then the second digit, and so on.
For example, if you have sections named 1, 2, 9, 10, 11, and 100, the system will sort them like this:
This happens because "1" comes before "2" and "9" as a character, so everything starting with "1" groups together regardless of how large the number is. The same logic causes 2-digit and 3-digit numbered names to appear interspersed with each other rather than in clean numerical sequence.
The solution is to make sure all numbers in your naming convention use the same number of digits. You do this by adding leading zeros to shorter numbers so that every name has the same total length.
Without zero-padding (sorts incorrectly):
With zero-padding to 3 digits (sorts correctly):
Because every name now starts with the same number of characters, the left-to-right character comparison produces the correct numerical order.
This naming convention applies anywhere you use numbers as part of a name or prefix a name with a number to control sort order, including:
Before you begin naming records, think about how many items you expect to have in that category and choose a digit length that can accommodate that count.
If you are unsure, it is always safer to use more digits than you think you need. Renaming records after the fact to fix sort order is time-consuming, especially for large templates.
Zero-padding works just as well when numbers are combined with descriptive text. The key is that the numeric portion of each name must have the same number of digits.
Incorrect:
Correct: