Forum Discussion
Sorting of values
Hi @v-shamilv,
Thanks for the suggestion, the tricky part in some cases 8.03 is the latest and in some cases 5.29.1 is the latest version.
I tried a mechanism where I look at the length of the Ver field, if its over 4 digits (using a filter) as for example 5.29.1, it works and shows 5.29.1 is the latest after a sort.
For another spreadsheet 8.03 is the latest and when I apply this the above methodology and we now filter 8.03 (4 digit length excluded) it's not the latest.
What makes it challenging the Firmware Build XXXXXXXXX adjacent column has no naming scheme which denotes the latest via alphabetical naming, think I may need another point of reference.
Hi avidthinker
Since version formats vary, sorting by length alone may not be reliable. A better approach is to split the "Ver" column into major, minor, and patch components using the . delimiter. Convert these to numbers and sort by major > minor > patch in descending order.
If a version has only two parts (e.g., "8.03"), assume a missing patch version as 0 (i.e., treat "8.03" as "8.3.0"). This should ensure correct sorting.
If this solution helps, please consider giving us Kudos and accepting it as the solution so that it may assist other members in the community
Thank you.