4 Replies Latest reply on Oct 16, 2014 1:03 PM by cn2

    Calculation result by a value in a field

    cn2

      Title

      Calculation result by a value in a field

      Post

      This is a calculation that returns an average of the scores. I need another field that would return the same value except based on a field quarter when quarter is equal to 1,2,3 or 4

      Let ( [ Q = GetSummary ( SumAverageQuiz ; SumAverageQuiz );
               T = GetSummary ( SumAverageTest ; SumAverageTest )
       ];
                       Sum (Q ; T) / Count (Q;T )
                       )

        • 1. Re: Calculation result by a value in a field
          philmodjunk

          Get summary does not need to be used in your example. When you repeat the summary field as your break field, you get a grand total type result--which is the same as if you used the summary fields in your calculation without using getsummary at all.

          Let ( [ Q = SumAverageQuiz ;
                   T = SumAverageTest
           ];
                           Sum (Q ; T) / Count (Q;T )
                           )

          Should produce the same result as far as I can tell.

          How will the value of "Quarter" affect your results? Do you intend to sort your records by quarter to group them by all records for the same quarter so that your calculation computes this value just for one quarter for each group of records from the same quarter?

          • 2. Re: Calculation result by a value in a field
            cn2

            Student table is related to the grading table by StudentKeyID GradingKeyID and gSubject = Subject

            A record in the grading table would have the following fields: Day, Score, Quarter

            So in a list of students from the student table, I have a portal showing the scores for each day. The above mentioned calc. returns the overall average for all the scores in the portal for that particular student. 

            There a 4 quarters so id like in addition to the overall average, 4 more averages but for each quarter.

            • 3. Re: Calculation result by a value in a field
              cn2

              I think i understand the question. This is a list layout so i'm not sorting the records. I do have a grand summary where i'd like it to be averaged by all students as well with each respective quarter

              • 4. Re: Calculation result by a value in a field
                cn2

                I achieved this by a relationship. thanks