2 Replies Latest reply on Apr 29, 2015 6:21 AM by DarwinCampbell

    Having problems with calculations and minimum and maximums

    DarwinCampbell

      Title

      Having problems with calculations and minimum and maximums

      Post

      In my database I have data collected every 30 minutes for each day, for each month during "a growing season". To calculate Growing Degree Days (GDD): If the temperature is 10*c or below, I use 10*c (Tmin), if it's 30*c or above I use 30*c (TMax), else the temp*c. It's easy to get the min and max for the day, but what I'm having problem with is using the min & max for the day to plug into the formula (Tmin + Tmax)/2-10*c. If I find one day it's works. When I find several months of data, it takes the Tmin and Tmax for the found set, when I need it calculated for each day. I would like to produce a report  with a sub summary by day, month and period selected for a report or export. I would appreciate any help you can provide or if you can point me in a direction.

        • 1. Re: Having problems with calculations and minimum and maximums
          philmodjunk

          I am assuming that you are using summary fields to get the min and max values. As you have discovered, using a summary field in a calculation results in the summary field returning a "grand summary" value. To get a sub summary value, you need to use the getSummary function. Specify the same "break" field in the getsummary function as you specify for the sub summary field's "when sorted by field".

          One potential issue to avoid is that, unlike a sub summary layout part, the break field in GetSummary must be defined in the same table as the summary field.

          • 2. Re: Having problems with calculations and minimum and maximums
            DarwinCampbell

            PhilModJunk, you NAILED it!!  I'm not sure I had a need before to use the GetSummary function, of if I did, it was years ago.  As I was researching my solution, I found and included it in the formula with zero results, and it was as you said because it was not in the same table.  moved the data in to the table and it worked perfectly.

            Thank you!!