I have a CSV file containing ObjectID and associated AttachmentNumber values. I want to group the ObjectIDs so that the total number of attachments in each group is as close to 1,000 as possible. How can I achieve this?
Hi @marta.podsiad I think you could use the StatisticsCalculator. GroupBy ObjectID and that should give you counts for attachments when selected in the Statistics to Summarize.
This method will create groups based on the attachmentSum. Each time the attachmentSum exceeds 1000, the groupID is incremented and the attachmentSum is reset.
It’s a bit tricky, and workbench will give alerts about non-existing attributes, but it will work :
You can then use the groupID attribute to create lists of obectIDs, concatenate, etc…