Cumulative totals

I have 1 to many related TOs: Patient_Event::__uuID = IO_event::_patient_event_uuID.

In IO_event are 2 fields:

- in_water_pc [% of a requirement]

- oc_Cum_in_water_pc [cumulative % of a requirement]

Both are presented in a 'Patient_Event' portal on the parent Patient layout. In the portal, both the % and the cumulative % are correct. However, if I look at the IO_event layout, for most records cumulative % = "?". Obviously if I export 'IO' records to Excel, cumulative % is incorrect.

I currently calculation cumulative % using this calculation from the 'IO_event' context:

Sounds like you need to define a summary field as a running total with the “reset totals when grouped by _patient_event_UUID” option. This assumes that you sort the records to group them on this value.

2. What I'm really wanting is a cumulative total of 'in_water_pc' (which is input as a % of requirement) - 100 to get the net % of the requirement met. So there needs to be a calc, then do the cumulative total.

The calc I originally had did the above, but as user19752 pointed out, there was no stopping parameter, so on the IO layout (that I export to Excel) you just get a long cumulative list.

If you specify a running total, 1) should not happen and you can, unlike non-running total summary fields, refer to the current total for that specific record in a calculation without using the get summary function.

But it’s possible that a running total is not what you need. Your get Nth record could be used to auto enter values from the preceding record and this then avoids the ? Problem. (But it’s not clear to me if you really need to use that method. )

3. Patient_event::uuID = IO_event::_Patient_event_uuID and in the IO_event portal on Patient layout oc_Cum_in_water_pc is correct.

The problem remains that I cannot get 'oc_Cum_in_water_pc' calculated restarting for each Patient_event on the various IO TOs I have tried. It either does a running total of all 'oc_Cum_in_water_pc' records or lists the first record's result for all records.

I don't think a Summary field can solve this, because I need the cumulative figure to be calculated as a net result compared to 100%. I suppose the result of a Summary field could later be used in a calc, but I'd hoped to avoid a chain of fields.

I suppose the result of a Summary field could later be used in a calc, but I'd hoped to avoid a chain of fields.

But you have just such a "chain" now and a far longer one that is returning ? when system resource limits are reached.

Referencing the value of a summary field in another calculation would only be a "chain" of two "links", pretty short chain and one commonly used when the total or subtotal returned by summary field needs further work to produce the desired result.