Formula fill summary records?

Is there a way to use formulafill to populate just summary records, based on the contents of the summarized data records, similar to the way Total, Maximum, or Minimum do?

I have a bunch of records, each representing an order. The records are grouped into chunks of approximately 10 orders for batch pulling purposes (so workers can pull all of the items needed to fill those orders on one circuit of the warehouse and then box them up, reducing the number of trips out to the warehouse). I want to create a cover sheet for each batch of orders, listing the items to be pulled, and quantities.

So I have a selection of several hundred orders, grouped into their intended batches, with summary records. Each data record has a field containing multiple order items in an array. I would like to append all of the order items in each batch of orders into one long array that gets dumped into the corresponding field in the batch’s summary record.

I’d like to do this without looping through all of the records (too slow) and without losing my selection. Any ideas? Is there a way to formulafill just summary records, without making a selection that excludes the data records?

It can be done with the help of the assign( function. This procedure will fill the summary records in a field named Text with comma separated arrays of the values in their respective groups.

local collector
collector = ""
Field Text
FormulaFill ?(info("summary") =0,«»,collector+assign((sandwich("",collector,",")+«»)[1,info("summary") =0],"collector"))

I’m doing some tricky things with my text funnel. [1,info("summary")=0] will be equivalent to [1,-1] when the summary level is zero (a data record) and it will be equivalent to [1,0] when the summary level is non-zero. [1,0] reduces the array to a blank, because it is about to start a new group.

1 Like

Fantastic! Thank you so much.