7 Replies Latest reply on May 21, 2009 9:19 AM by raybaudi

    Counting vacation days

    cps-tech

      Title

      Counting vacation days

      Post

      I am trying to set up a basic database that tracks staff days off (vacation, sick...)I can get it to count the days I have off, but I cannot figure out how to account for half-days off.  I was using the count feature:

       

      sick_count = If(attendance_Type="Sick";1;0) and combining that with a summary field of total_sick=Summary of sick_count

       

      but that only works for people taking a whole day off.  I need it to count by .5 for half days AND 1 for whole days.  How can I have it count by ones for whole days and count by .5 for half days?  Is there a way to count occurances when BOTH day_length=.5 AND attendance_type ="Sick" and then combine that with day_lentgh=1 AND attendance_type="Sick"

       

      I know my way around FileMaker a bit, but I am far from an expert on these calculations.

        • 1. Re: Counting vacation days
          raybaudi
            

          Hi

           

          try this calculation for sicK_count :

           

          ( attendance_Type = "Sick" ) * Day_lenght

          • 2. Re: Counting vacation days
            cps-tech
               I still get a zero returned, but can I assume that is because my attendance_type="Sick" is a text field?  It almost seems like the numerical values I have in day_length (.5 and 1) are not being treated as numbers even though they are defined as a numeric field.  Counting the records work, but I cannot perform any mathmatical calculation using that value.
            • 3. Re: Counting vacation days
              raybaudi
                

              Did you copy exactly my calculation ? ( included both brackets )

               

              ( attendance_type="Sick" ) is a boolean calc and should return 1 ( if the field attendance_type contains "Sick" ) or 0

               

              so:

               

              ( attendance_type="Sick" )*day_length should return either 0, .5 or 1

              • 4. Re: Counting vacation days
                cps-tech
                   Yes, but I think I am still tripping over the day_length field.  I have that set to a Value list (1 or .5).  I have tried formating it as both general and "Leave Data Formatted as Entered" (under Number Format..).  Interestingly enough, even when I make it a straight numeric field, I still cannot get the calculations to work.  I am also still a bit unsure how these would all add up the different days off during the year and calculate a total.  I don't know if it matters, but I have all the dates (sick, vacation...) that a particular person took off showing up in a portal on the page, and that is why I thought I might use the count feature.
                • 5. Re: Counting vacation days
                  raybaudi
                     Is the field Day_lenght in the same table of the field attendance_Type ?
                  • 6. Re: Counting vacation days
                    cps-tech
                       Yes, they are both in the same "Attendance" table.  THere is a separate table that contains information about each person.  Thank you for your continued help, it is greatly appreciated.
                    • 7. Re: Counting vacation days
                      raybaudi
                        

                      I have no more idea on what can be the problem with that calculation...

                       

                      If you want I can see your file...

                       

                      Edit: I found two errors. Now it works.