Can you create a Filemaker calculation field that lists the values checked by commas?

ServalStudios
ServalStudios used Ask the Experts™
on
I have a value list for a record that has check boxes for A B C D.  I want create a calculation field that I can place in other area, say a letter, that only lists what is selected.  So say the record only has A C and D checked, I would like to create a calculated field that says "you have selected a,c,d" .  Is this possible?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
That type of field is called a check box field. If you create one and add a list of values to it... ABCD then there will be a filed with four small boxes one next to each letter and you can select one or many of the choices. The field will contain a value "ABD" if you selected that combination and "B" if you only select B. Then you can create a relationship to each of the letters so that it can be used as a filter.
Sure!

"You have selected " & Substitute ( fieldX ; ^p ; ", " )

Again, the ^p here stands for the paragraph mark. In the calculation you are putting two strings together, the "You have selected " part (note that there is a space after "selected ". and the content of fieldX.
However, we don't want a list like this:
A
C
D
We want a list like this: A, C, D
So we substitute  ", " for  the paragraph mark.
Will LovingPresident, Dedication Technologies, Inc.
Commented:
The only issue you may have is that values in a checkbox field appear in the list in the order that they were checked, so if they were checked in the order of A - B - C, then they will appear in that order. But if they were checked in the order of C - B - A then that's the order they will appear in ChallengeDay's calculation.

FileMaker has not built-in sort function for this sort of thing  so you have to resort (both puns intended) to a custom function such as found at: http://www.briandunning.com/cf/1181  There are many other custom functions for sorting lists, just search on Sort List at the Brian Dunning's site. Custom Functions require FileMaker Pro Advanced to install. If you were to use the above custom function, your calculation would look like this:

"You have selected " & Substitute ( SortList( fieldX ; "Asc" ; "Text" ) ; "¶" ; ", " )
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Wow, so cool that you got the paragraph mark ¶  to show in Expert's Exchange, mine always showed up as a question mark. Thanks willmcn!
Will LovingPresident, Dedication Technologies, Inc.

Commented:
Must be because I'm working from a Mac   ;-D

Author

Commented:
Thanks so much for your help.  I am working on lots of changes to existing database and this helps a great deal.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial