2 Replies Latest reply on Sep 5, 2015 4:13 AM by sccardais

    Problem totaling results of GetSummary in Sub Summary Report

    sccardais

      I want to total the values in the far right column - Net New Clients - in this sub summary report.

       

      c_NetNewClient is a calc field with the calculation shown below.

       

      GetSummary(s_TotalNbrOrders;Edition) - GetSummary(s_TotalNbrCancellations;Edition)

       

      I am sorting on Edition and the results in the sub summary part are correct. But I have not been able to total their results in the Trailing Grand Summary part. The field, s_NetNewClients (summary, total of c_NetNewClient) does not work.

      Total calc using GetSummary function.png

      What am I doing wrong here?

        • 1. Re: Problem totaling results of GetSummary in Sub Summary Report
          erolst

          If “does not work” means “returns wrong result“: the problem is that this result is the sum of the calculation result for every record, not just one per group (edition).

           

          You can either create a dedicated calculation field as

           

          GetSummary ( s_TotalNbrOrders ; s_TotalNbrOrders ) -

          GetSummary( s_TotalNbrCancellations ; s_TotalNbrCancellations )

           

          where using the summary field itself a s break field returns the result over all records of found set; or simply calculate the result only for the first record in a group, i.e. once per group, as:

           

          Case (

            edition ≠ GetNthRecord ( edition ; Get ( RecordNumber ) - 1 ) 

            GetSummary(s_TotalNbrOrders;Edition) -
            GetSummary(s_TotalNbrCancellations;Edition)

          )

          • 2. Re: Problem totaling results of GetSummary in Sub Summary Report
            sccardais

            Yes. “It does not work” means it returns the wrong result.

             

            Thanks for the explanation of “why” it doesn’t work.

             

            I’ll try both of your suggestions. Thank you.