1 Reply Latest reply on May 14, 2009 11:37 AM by comment_1

    Need help figuring out how to do this calculation for a report

    Victor

      Title

      Need help figuring out how to do this calculation for a report

      Post

      Hello,

       

      Basically i have student database with students hours, city, program, student id. I am trying to find out what the total of hours attended base of hour range are for a city,example of the hours range i am looking to do is 1-60 hrs, 61-200, 351-450. my field are: total_allhours, student name, student id, city. 

       

      so i want to show: city a, 1-60=20 students with that range of hours attended, 61-200=10 student with that range of hours attended

       

      total of all hours are been calculate by the field total_allhours. 

       

      thank you

      Vic 

        • 1. Re: Need help figuring out how to do this calculation for a report
          comment_1
             I don't understand exactly what your fields are, so let me take a simple example: suppose we start with these fields:

          • StudentID
          • City
          • Hours

          Now we add two more fields:

          sTotalHours - Summary, Total of Hours
          cCityCategory - Calculation (result is Text) =
          Let (
          cityHours = GetSummary ( sTotalHours ; City )
          ;
          Case (
          cityHours ≤ 60 ; "1-60" ;
          cityHours ≤ 200 ; "61-200" ;
          cityHours ≤ 450 ; "251-450"
          )
          )


          Place the cCityCategory field in a sub-summary by City part.