Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7012 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I have twenty-five fields defined as Yes/No radio buttons. I want a calculated text field to combine the results so that if buttons 1,3, & 15 = "Yes" then Combined_Text_field = text_1 + text_2 + text_15 and so forth for all possible combinations. Can someone point me in the right direction with this calc? I know one way would be for me to set individual global text fields for each radio button and then combine them all in the combined field. I was just wondering if there was a way to avoid this intermediate step.

Edited by Guest
Posted

Are you trying to get the field names? or the field values?


Let([

a = If(field1 = ""; ""; "field_name + ";

......

y = If(field 25 = ""; ""; "field_name"];



a & b & ........ & y)

Although I'm sure the smart people here can give you a more eloquent solution, that should work.

Posted

No, I'm not trying to get the field name. I was going to specify the text value within the calc itself. Thanks for the suggestion on using the "Let" statement, I'll give it a try. This might also be a place to try a custom function but I'm unsure about how to go about it.

Posted

If we for a while ignore that such things should be structuralized as portalrows could it be done this way:

PatternCount(field1 & field2 & field3 & field4;"yes")

--sd

Posted

I'm afraid your post makes no sense to me. If you have radio buttons with "Yes", the only field value will be "yes".

...twenty-five fields defined as Yes/No radio buttons. I want a calculated text field to combine the results so that if buttons 1,3, & 15 = "Yes" then Combined_Text_field = text_1 + text_2 + text_15 and so forth for all possible combinations.

You want the answer of: Yes Yes Yes Yes Yes Yes Yes Yes Yes ? Hmmm, maybe there are OTHER fields involved that you want concatenated? Something like:

TrimAll (

If ( button 1 = "Yes" ; Text1 ) & " " &

If ( button 3 = "Yes" ; Text3 ) & " " &

If ( button 15 = "Yes" ; Text15 )

; 0 ; 0 )

?? If it is literal text, just change Text1 to "yourText" ... including the quotes.

This is a good example why flatline multiple like-field thinking can be problematic. You will continually struggle with this type of structure. If you can tell us what you're doing it might help us get the vision. Right now I'm a bat. :wink2:

LaRetta

Posted

I guess thats my question too. I originally assumed you wanted field names because I couldn't see what good having:

"Yes Yes Yes Yes Yes Yes Yes Yes...."

would do.

Although my original calc would still work, just replace "field_name" with "Yes" I don't really see why you would want this. If you post us a little more information, I'm sure you will get someone to help you who can come up with a much better solution.

Posted

When I tried to use "PatternCount" it returned a numeric value based on how many "Yes" buttons I select so that doesn't appear to work.

and

so forth for all possible combinations.

Alright, it seems like you wish to make searches for certain polling patterns - If thats what you're after could it be done this way:

Exact ( field1 ; "yes" ) * 2^0+

Exact ( field2 ; "yes" ) * 2^1+

Exact ( field3 ; "yes" ) * 2^2+

Exact ( field4 ; "yes" ) * 2^3+

Exact ( field5 ; "yes" ) * 2^4+

Exact ( field6 ; "yes" ) * 2^5+

Exact ( field7 ; "yes" ) * 2^6+

Exact ( field8 ; "yes" ) * 2^7+

Exact ( field9 ; "yes" ) * 2^8+

Exact ( field10 ; "yes" ) * 2^9+

Exact ( field11 ; "yes" ) * 2^10+

Exact ( field12 ; "yes" ) * 2^11+

Exact ( field13 ; "yes" ) * 2^12+

Exact ( field14 ; "yes" ) * 2^13+

Exact ( field15 ; "yes" ) * 2^14

--sd

Posted

Yes LaRetta, That is exactly the formula that I needed. Thank you! Now, one more issue. I have a text field labeled "Other" (for choices not listed using the radio buttons) and the aforementioned combined text box where all the results are listed. How do I have the text "All For One" appear in the combined box if all radio buttons are either = "No" or not selected and the "Other" text field is empty? I have attached the sample file if you need to see it.

Radio_Test.zip

Posted (edited)

You can define your current formula as a variable in Let() function. Then return:

Case ( IsEmpty ( yourVariable ) ; "alternate text" ; yourVariable )

---

I share LaRetta's feeling that overall this is not a good approach to any real problem I can think of.

Edited by Guest
Posted

Still being new to this, it doesn't surprise me that there is a better approach to what I'm trying to accomplish. :) Sorry for being so abstract, I should know better. I know you all need a clear picture to really offer the best help. My apologies. Here's the skinny:

1. End-user has a tablet PC (stylus entry) making items like check boxes and radio buttons ideal.

2. A laundry list of items (chemical reactions ie. Reaction1, Reaction2, etc) is listed.

3. A report will be generated in a separate field based on which items on the list are checked positive or negative by the user.

4. The report reads either "The following reactions occurred: Reaction1, Reaction2, etc." or if no items selected it reads "There were no reactions."

Posted

My solution: I created a numeric autocalc field (radio_calc) so that each time a "Yes" button was selected, it set radio_calc to (radio_calc + 1). Then I used: If(radio_calc = 0;"There were no reactions.")

There is probably a more elegant solution, but this seems to work. Thanks.

Posted

Question: in your table, what is a record?

I am under the impression that each a record is an experiment, and each experiment has a series of tests and their results. In such case, I would record the results in a related results table, in essence a join between Tests and Experiments. This would make any kind of reporting very easy.

This topic is 7012 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.