9 Replies Latest reply on Apr 10, 2013 4:27 AM by JimMac

    Checkbox Selection to set Date

    JasonMcCullough

      Title

      Checkbox Selection to set Date

      Post

           Hey guys,

            

           using the assests template and modifying it to suit my needs but I need to be able to set assets to a renewel date for testing periods. 

            

           I have set up a checkbox system which is 3 months, 6 months or 12 months and I want the renewel date to auto fill for me. 

            

           Can anyone explain how to do this im new to filemker and while worked out most other things im getting stuck on this. 

            

           Also is there anyway to set it so that I can get a list and reminders as to when I need to retest equipment for instance

           Item 1 - Assigned to (fred) renew 6 months

           but I want a reminder in 4 months that fred has items that need to be retested so I need to then be able to access his files so I know which items and location they are in...does that make sense? 

            

           Thanks in advance

            

           Jason

        • 1. Re: Checkbox Selection to set Date
          JimMac

               Check Box type format will allow all 3 of your renewal to be checked off.   3 AND 6 AND 12.  I am guessing you want ...

               3 OR 6 OR 12  thus a unique calculation which is Radio Button type format.  

               True?

               Jim...

                

          • 2. Re: Checkbox Selection to set Date
            JasonMcCullough

                 Hi Jim,

                  

                 Im not sure of what your saying there 

                  

                 I really want it that 

                 IF (Checkbox 1 (3 Months) ) is selected the renewel date will be todays date+3 months (Calendar Months)

                     (Checkbox 2 (6 Months) ) is selected the renwel date will be todays date+6 months

                     (Checkbox 3 (12 Months) ) is selected the renewel date will be todays date+12 Months

                  

                 Save me having to select a date 3 months down the track on a drop down calendar 

            • 3. Re: Checkbox Selection to set Date
              JimMac

                   What if I check all 3 of them? What would be your calculation?

                   A radio button only allow one to be selected.

                   use a Choose Function  with the full label of each Radio Button item.  ie, "3 months"

                   RenewlDate = Choose( YourDateField = "3 months"; 3 : YourDateField = "6 months"; 6 ; YourDateField = "12 months"; 12) *30 + Get(CurrentDate)

                   Jim...

                    

              • 4. Re: Checkbox Selection to set Date
                JasonMcCullough

                     Hi Jim,

                      

                     Sorry it would only be one option as ech item only requires one option to be selected on their type of equipment.

                      

                     so I need to use a radio button is that what you are saying? 

                • 5. Re: Checkbox Selection to set Date
                  JimMac

                       Yesyes.  

                       Otherwise you could get more than one follow up date.  Then you can use several way to turn that  Value List of Options to decide which one the User picked.  Radio Button style selects only one, like your car radio {one station at a time or pick that station OR this one}

                       Where Check Box style is pick one or all that apply { this AND that AND others }.

                       I conceptualized a calculation using the Choose function on how to get the multiplier for 30 day months. In that example, YourDateField would be the Radio Button Field Values.

                       Using Radio button assure you of ONE follow up date.

                       Jim...

                  • 6. Re: Checkbox Selection to set Date
                    philmodjunk

                         If you need precise months instead of 30 day intervals, you can use the date function and add 3, 6, 12 to the months paramter in the date function.

                    • 7. Re: Checkbox Selection to set Date
                      JasonMcCullough

                           Really sorry for all the questions thought I understood a bit more than I do....

                            

                           Jim in your message you have;

                            

                      Choose( YourDateField = "3 months"; 3 : YourDateField = "6 months"; 6 ; YourDateField = "12 months"; 12) *30 + Get(CurrentDate)

                            

                      Can you explain to me how to write this so it sees my radio boxes. 

                            

                      I have 

                      Test Date : Which is todays Date

                      Renewel Date: Which needs to look at my test period data (Display Data From Assests:Test Period) which has the 3 options

                      then I have another box Days Until Due, but this is not a neccasary thing just a nice thing to have. 

                            

                      Really sorry once again.

                      • 8. Re: Checkbox Selection to set Date
                        JimMac

                             I am going to use your Field names and first define them so we are on same page.

                             1) TestDate [Date]  .... date the record was created or Current Date.

                             2) RenewalDate [Text]  .... Radio Control option .... Using this EXACT ValueList names   3 months  6 months   12 months

                             The Value list is what used to label a Check box or  Radio button type control.  If you select say,   6 months.  The RenewalDate Text field will contain the text = 6 months  so that when you do a logic check, you compare that text field.  IF [RenewalDate = "6 Months"]  would be true in this example.

                             Now lets create a Follow up Date field,,,  not listed in you post....

                             3) FollowUp [Calculation]   which is a calculation type field and  you would insert the CASE Funtion, my bad, not enough coffee beforesad

                        Case( TestDate = "3 months"; 3 ;    TestDate = "6 months"; 6 ;    TestDate = "12 months"; 12;    0) *30 + TestDate

                             The Case function test each logic until if finds a true logic or default to last number I set = 0.  In the example of selecting say 6 months, the Case function would result in the numeric value of 6.  Then it would be 6*30 or 180 days added to the TestDate.yes

                             So...

                             Our new Calculation type Field....FollowUp ... would have your follow up date and NOT the RenewalDate field.

                             But....

                             You asked for a new fieldcool.

                             So lets change the that calcultion up a bit by re-defining the calculations a bit.

                             4) DayUntilDue [Calculation]  defined as...

                        Case( TestDate = "3 months"; 3 ;    TestDate = "6 months"; 6 ;   TestDate = "12 months"; 12;   0) *30     // now calcs days only

                        3a) FollowUp [Calculation]  which re-defined new as...

                        DayUntilDue + TestDate wink

                             As Phil suggested I just use the average of 30 Days per month for simpilicity of this post.  You can do it exactly by using the Date functions, if you wish, but I don't want it to confuse our discussion

                             Anyway.... Here is his suggestion... for exact dates since months change the total days per month.

                             3b) FollowUp [Calculation]  which re-defined new a 3rd time...

                        Date ( Day (TestDate)  ,  Month (TestDate) + Case( TestDate = "3 months"; 3 ; TestDate = "6 months"; 6 ; TestDate = "12 months"; 12; 0))  +  Year (TestDate)  )

                             Whew..... surprise  that is compounding Date (d,m,y) with Day(Date), Month(date), and Year (date) all in FMP Help, to compute exact Date.

                             then...

                             4a)  DayUntilDue [Calculation]  re=defined as...

                        FollowUp - TestDate

                             Don't worry we all started off a bit wobbly, but if you grasp this... you are on you way...

                             Jim...

                             PS: I have even refined this to make sure my FollowUp date didn't fall on a weekenddevil.

                        • 9. Re: Checkbox Selection to set Date
                          JimMac

                               WOW i do need more coffee....crying

                               In my CASE examples please change  the TestDate fields to RenewalDate Field in the Case statments.

                          OR...

                          Case( RenewalDate = "3 months"; 3 ;    RenewalDate = "6 months"; 6 ;    RenewalDate = "12 months"; 12;    0) *30 + TestDate

                          and....

                          Case( RenewalDate = "3 months"; 3 ;    RenewalDate = "6 months"; 6 ;   RenewalDate = "12 months"; 12;   0) *30     // now calcs days only

                          and...

                                

                          Date ( Day (TestDate)  ,  Month (TestDate) + Case( RenewalDate = "3 months"; 3 ; RenewalDate = "6 months"; 6 ; RenewalDate = "12 months"; 12; 0))  +  Year (TestDate)  )

                               a Big sorry to you.... I probably just did a major confusion...
                               Jim...