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:
edition ≠ GetNthRecord ( edition ; Get ( RecordNumber ) - 1 )
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.