1 2 Previous Next 18 Replies Latest reply on Jun 11, 2016 7:30 AM by keywords

    Radio Button values for equations

    kaotishe

      I need to be able to set values of 0, 1, 2, 3 to a set of radio buttons that can then be plugged into an equation in a related field. Ideas?

        • 1. Re: Radio Button values for equations
          keywords

          Radio buttons are merely a convenient means of data entry. Create a value list using 0, 1, 2, 3 as custom values. Make sure the field itself is a number field. The value in the field will be the one selected by radio button, which you can then use mathematically just as if the number itself was entered—which indeed it is.

          • 2. Re: Radio Button values for equations
            kaotishe

            Let me clarify a bit. The radio buttons already have a text value assigned to them. They are used to track employees skill levels: i.e. intern, 2nd shooter, 1st shooter, pro shooter. I want to also use them in calculating pay grade so i don't have to enter the same information twice for each person. So if I just change the value set, sure the calculation will work, but nobody looking at the database is going to know what it means or what the numbers are for...

            • 3. Re: Radio Button values for equations
              kaotishe

              So how do I change the Value set, but keep the original labels?

              • 4. Re: Radio Button values for equations
                keywords

                In that case your best option is probably a second field which gives the equivalent number value. You can use an auto enter calc such as the following:

                Let ( [

                rank = <theNameOfTheTextFieldHere> ;

                level = Case ( rank = "intern" ; 0 ; rank = "2nd shooter" ; 1 ; drank = "1st shooter" ; 2 ; rank = "pro shooter" ; 3 )

                ] ;

                level

                )

                • 5. Re: Radio Button values for equations
                  kaotishe

                  This almost works... What it is not doing is recalculating the value when the radio button gets changed. What am I missing?

                  • 6. Re: Radio Button values for equations
                    keywords

                    Make sure you have unchecked the "do not replace" option in the auto enter setup—

                    Screen Shot 2016-06-08 at 11.53.21 AM.png

                     

                    Alternatively, you could make the second field a straight out calc field instead of auto enter—but this depends on your requirements.

                    1 of 1 people found this helpful
                    • 7. Re: Radio Button values for equations
                      kaotishe

                      That was what I missed. It is working perfectly now. Thank you for your help.

                      • 8. Re: Radio Button values for equations
                        kaotishe

                        OK so I thought everything was fixed. The Back End of the process is, but there is some kind of hang up in the Front End.

                         

                        What I am trying to get Filemaker to do is calculate all employ pay rates going from a ( base pay grade ) + ( photographer skill level ) + ( photo job clearance ) = ( pay rate ).

                         

                        The back end of this works, the skill level is the radio buttons I needed code for, the job clearance is a set of checkboxes which the program ValueCounts. All of that works like it should. But if I change the base pay grade from 10 to 11 nothing gets recalculated on the records unless I go in and also fiddle with the checkboxes or the radio buttons. Which means I would have to do that on every record...

                         

                        I have tried using a global field for ( base pay grade ) and using a related table to enter the change in ( base pay grade ) neither seem to make a difference. I have also confirmed that the "do not replace existing value" box is not checked, unless I am missing a second one somewhere. The ( pay rate ) field is set to always validate, I have even tried setting it to validate with equation and used the same equation for the calculation. But I can not get it to recalculate based on a change made to ( base pay grade ).

                         

                        Any ideas?!?!?

                        • 9. Re: Radio Button values for equations
                          user19752

                          ( base pay grade ) may be in the another table.

                          • 10. Re: Radio Button values for equations
                            kaotishe

                            It is not used anywhere else. It appears that there is no way to force a recalculation based on a global field or a related table.

                            • 11. Re: Radio Button values for equations
                              user19752

                              If global field is in the same table, it trigger recalculation.

                              • 12. Re: Radio Button values for equations
                                keywords

                                Your reply prompts me to question your data structure. It is likely that data such as base pay grades SHOULD be stored in its own table and then copied to each transaction record, so that in that record it is NOT altered when the pay grade changes. It is the same as an invoice: you sell something at the price that is current at the time of sale; you do not then want your invoices recalculated when the price later changes. In your case, you say there are three elements to calculating the actual pay rate—( base pay grade ) + ( photographer skill level ) + ( photo job clearance ). Each of those figures should be particular to a given transaction. Just as already stated, you do not want the pay rate for a past transaction to be recalculated when any one of those changes in the future.

                                 

                                So—you should have each of the three fields in the table where pay rate is set, and data should be copied to each field from wherever it is stored. If base pay grades are stored in a separate table it is a simply matter to auto enter the current grade when a transaction record is created. If skill level is stored in a photographer's personnel record, the same thing applies—you auto enter the current skill level for that photographer; ditto job clearance.

                                 

                                So the correct setting for such auto enter fields is to leave checked the "do not alter existing value" option to prevent accidental recalculation. The advantage with an auto enter is that the data has its own separate integrity, and can be altered directly as needed (e.g. if you decide to pay penalty rates for a specific transaction).

                                • 13. Re: Radio Button values for equations
                                  mgostovich

                                  Make sure that you don't have any of them and set to store the calculation in the indexing

                                  • 14. Re: Radio Button values for equations
                                    kaotishe

                                    These are not transaction records. The transaction records look here for ( Pay Rate ) at the time they calculate pay for a particular job. These are photographer records, name, address, skills etc. The problem is that I have not found a way to trigger an out recalculation across all of the photographer records if / when there is a wage changes to the ( Base Pay Grade ). After changing the ( Base Pay Grade ) I still have to go through every record and make a change to one of the other fields of that record to recalculate the ( Pay Rate ). OR I have to use some kind of non global value for ( Base Pay Rate ) which means I still have to go in and adjust every record. I.E. when minimum wage goes up I can't just make one adjustment and it fix all of the records.

                                    1 2 Previous Next