Sort Multi-Value Checkbox Field in Specific Sequence
I have a checkbox field (Students::DaysAttending) with four possible values: "M," "T," "Th," "F," these being the equivalent of Monday, Tuesday, Thursday and Friday (school days where students attend at my wife's school). Being a checkbox, the user can of course select/de-select any value in any random order, and being a checkbox field, these values are added into the return-delimited list of values in the order they are selected. Therein lies my problem.
I take the values from this field and manipulate them in another calc field and process the values in a number of ways for a variety of uses. One particular use involves the application of a Merge Field (<<DaysAttending_Horiz_spelled_w_and>>) in a list view sub-summary part which yields the following example results, depending upon user selection in the DaysAttending field:
- Monday, Tuesday and Friday
- Monday and Friday
- Tuesday and Friday
- Monday, Tuesday, Thursday and Friday
Of course, more day combinations are possible, but you get the point.
My above example assumes the user selected the checkboxes in the natural order in which they occur during a week and so the sequencing looks perfectly fine here, but that won't necessarily be the case in every event.
I need to sort the resulting calculation field to ensure that the days, as few or as many as they are selected by the user, always display to reflect the natural order they occur in the week. My online search results find some examples that vaguely relate to my problem but not exactly.
Has anyone done this before? Does a built-in function accomplish this?
Thanks, as always.