3 Replies Latest reply on Aug 1, 2012 3:49 PM by davidjhayden

    Sort Array by Value List?

    davidjhayden

      I need to custom sort the individual values of an array -- preferable by the sort order of a values list. Example...

       

      I have a checkbox field with days of the week, with options defined by a value list. Checking multiple values produces an array like:

       

      Monday

      Tuesday

      Thursday

       

      I need to use that array value in a report, separated by commas, so I have a calculated field set to Substitute (Days; ""; ", "), which give me this: Monday, Tuesday, Thursday. Perfect, as long as the user enters the days sequentially. However, if they do not, then the calc may look like this: Tuesday, Thursday, Monday.

       

      I need them sorted in proper order. I've found a custom function that will do alpha and numeric sort, but not based on a value list.


      Ideas?

       

      Thanks!

       

      Dave

      dhayden@museumdatasolutions.com