Imagine a Table with a column called “order” with rows like:
depending on the context, some rows might have more dots than others.
Does any one know a clever way to sort it without building tons of helper columns?
Thanks in advance.
Heres an easy way to do it using
Regex can be an intimidating formula, but is honestly one of the most useful Coda formulas you can have in your toolbelt. Heres some thorough documentation on how to use the different Coda Regex formulas!
Thanks for the answer Scott.
I think I was not very clear. I actually want to sort rows by the hierarchy of the version. This means, for example, that a row version 2.2.2 would be higher than 22.214.171.124.1, because the hierarchy is left to right.
In your example, if I use the results to sort the rows, it would put 126.96.36.199.1 in a higher position than 2.2.2, which is not what I intend to do.
So it would be
I think what @Felipe_Griebel means is that using your method would result in numbers still out of order.
For example 2.2.2 becomes 222 and 188.8.131.52.1 becomes 21,111.
Number order would still be the way to go. I think the best solution would be adding zero’s so that they are all 5 to 6 digits.
Then the sort would be
Hope that makes sense.
I have found a solution!
Thank you for your time.
What Dale described is knows as zero-padding sort and is a common practice among back-end developers. I am not a dev, so I was having a bit of trouble implementing it in Coda tables, but now I did it.
My main purpose was to organize parent-child like structures so the views would have a coherent visual output.
like this from → to
Or this from → to
Here is the shared solution
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.