Unanswered How would I sort a list by an ID such as 2.1.4, 2.1.14, 2.1.1, 2.1.6

  • Wednesday, August 01, 2012 4:12 PM
     
     

    The 2.1.14 always comes before 2.1.6 etc., because SharePoint sees the .14 comining before the .6

    It has to be a easier way to sort this. Any help will be appreciated.

    Mike


    Michael L. Williams

All Replies

  • Wednesday, August 01, 2012 5:17 PM
     
     

    Mike,

    Perhaps you could add a calculated column that parses out the pieces of the id to build a numerical value and then sort on that column.

  • Wednesday, August 01, 2012 5:31 PM
     
     
    I've tried that and parsed out the ". .", but it's still reading it as 2.1.6 and I would have to add a "0" after the second "." inorder for it to sort correctly. Such as 2.1.06. That will cause all items to have the 0 after the ".", like 2.1.014.....so I don't think that will work.

    Michael L. Williams

  • Wednesday, August 01, 2012 5:38 PM
     
     

    Understood.  I was thinking you could prepend zeros for each number to form a standard size.  Some examples:

      2.1.6   -> 000020000100006
      2.14.2 -> 000020001400002

    Alternatively, you could subtract the numbers from 10000 and sort inversly.  Some examples:

      2.1.6   -> 999989999999994
      2.14.2 -> 999989998699998

  • Wednesday, August 01, 2012 5:56 PM
     
     

    Try creating a secondary meta-data column to hold the next set of digits then group by it

  • Thursday, August 02, 2012 2:47 PM
     
     
    I was thinking about trying to use the Trim function and trimming the .14 off of let's say 2.1.14 and placing the .14 in a secondary metadata column and sorting off of that secondary. Theoretically it should work. I hope.

    Michael L. Williams