7 Replies Latest reply on Dec 11, 2013 3:41 AM by bruns

    Calculation Issue

    bruns

      Title

      Calculation Issue

      Post

           We have vessels, I have a date on field (date_on) and a dateoff field (date_off).  I have this in a portal.  I have a field to calc the number of days on vessel by using the 2 dates.  My issue is, I have someone that I have a date on for but they have not gotten off yet, the system put a ? in the field and therefore it will not count the other dates.  When it show up in my report, it has a negative number .  I assume all of this is because I have not put a date off in yet, what can I do or is there  a script that will work around?  Thanks if you can help.

        • 1. Re: Calculation Issue
          philmodjunk

               If ( IsEmpty ( DateOff ) ; Get ( CurrentDate ) ; DateOff ) - DateOn

               You'll need to make this an unstored calculation, however, to get it to update correctly when DateOff is empty.

          • 2. Re: Calculation Issue
            bruns

                 If I can add one more twist to the mix.  By the way the other calc worked great.

                  

                 I have a field (# of days on vessel today) unstored and is working as it is Get (CurrentDate) - date_on_board. 

                 How would I go about when I put the date_off_vessel that it makes the  field (# of days on vessel today) blank. 

                  

                 If that did not make since, please let me know.

            • 3. Re: Calculation Issue
              philmodjunk

                   If ( IsEmpty ( Date_off_vessel ) ; Get (CurrentDate) - date_on_board )

                   You could also use Conditional formatting or FileMaker 13's new "hide Object when" behavior setting to hide it from view.

              • 4. Re: Calculation Issue
                bruns

                     I am trying to do a conditional format on Next crew change field.  If date off vessel in filled in then the next crew change field goes blank.

                      

                     This the the conditional format I used on next crew change field

                     If ( not IsEmpty (Vessel Assignments::date_off_vessel) ;" ")

                     It looks right to me but it is not doing anything.  If I fill in date off vessel, nothing changes on the crew change field.

                      

                     Is this not correct?

                • 5. Re: Calculation Issue
                  philmodjunk

                       With versions prior to FileMaker 13, I'd use:

                       IsEmpty (Vessel Assignments::date_off_vessel)

                       and specify a font size of 120+ points to make the contents of the field invisible.

                  • 6. Re: Calculation Issue
                    bruns

                         On that unstored calc, if I go back and change the date of date off, it is not updating numbers .  I am uploading the file, it is happening under the Vessel Assingment Tab. 

                          

                         I think I had a redundent field, I am looking at it to see what I think now.

                          

                    • 7. Re: Calculation Issue
                      bruns

                           Never mind, I cannot see the forest for the trees.

                            

                           Thanks