November 22, 201114 yr I have a checkbox field called 'Age' that contains the following possibilities of target age group for which my games are intended for; 2 - 4 5 - 6 7 - 9 10 -15 Some games can be played by both toddlers & older children, so I have ticked two, three or all of the checkboxes. When clients search the games database, They view the game description and under age they see a field called 'Age inclusive' which is a formula grabbing the left word &"-"& the right word of the 'Age' field, which works nicely when I have ticked one box or ticked several in order from lowest to highest. HOWEVER, if I tick '7 - 9' and then '2 - 4', the calculation result is '7 - 4', because filemaker stores multiple entries selected in checkboxes in order they were selected. How in the world can I make sure than no matter in what order the checkboxes are selected, they are sorted lowest to highest providing the 'Age inclusive' formula the correct result every time. Or maybe there is a more elegant solution to this seemingly simple problem, Thank you so much for your time and help
November 22, 201114 yr Why not simply have a minimum age field (and a maximum age field, if you feel that's necessary). No checkboxes, just a set of number fields.
November 22, 201114 yr Try: Let( checked = FilterValues ( ValueListItems ( Get ( FileName ) ; "TheNameOfYourValueListInQuotes" ) ; YourCheckboxField ) ; LeftWord ( checked ; 1 ) & " - " & RightWord ( checked ; 1 ) )
November 23, 201114 yr Author Raybaudi - You are a genius my friend! Worked like a charm. Out of curiosity, what is this formula actually doing? I don't find the function 'checked'? Thanks a milion!!!
November 23, 201114 yr "checked" is not a function, but a parameter of the Let ( ) function. Think at it as to another calculated field ( that I named "checked", but I could even name it simply "c" ). The ordering of values is made possible by the FilterValues ( ) function.
Create an account or sign in to comment