on 07-21-2016 08:08 PM - edited on 07-27-2021 11:38 PM by APIUserOpsDM
How To: Split an Output into Multiple Files with Specific Record Counts
Sometimes, you may want to write data to multiple files, with each file containing a specific number of records. You can leverage a Record ID column to do exactly that!
Procedure
CEIL([RecordID]/25)
A sample workflow is attached.
Big relief, 1000 STARS to this post.
This is helpful. Thanks !
Great, @KylorI! Glad to hear it!
Hi... Appreciate for this time-saving solution.
In addition to this I want to split the records into separate sheets based on a record count with a dynamic file name.
For example I have records which need to go to different files based on an input column, say City
(each file will have separate sheets with the # of records I set using Group ID).
I already use a variable FileName which has "C..\.."+[City] which I use in Change Entire FilePath.
Within each city how to split into different sheets based on Group ID?
In my project I have a column of the name of individuals, these individuals each have a different number of flags.
Instead of putting 25, how do you go about putting the number of flags each person has correspondingly?
Hello,
I have a bit of a twist on this.
I have a summarized data set that shows an account and the number of transactions they had. My goal is to split this set of 90,727 accounts as evenly as possible based on 2 factors; # of Accounts as well as sum of transactions for the set.
Not sure of how to go about doing this. One of these variables is obviously easy but splitting as evenly as possible based on record count and sum of their transactions I am unsure in a perfect world based on my data the breakdown would be 3 sets of ~30242 Accounts and ~5,886,395 Transactions as I have 90,727 Accounts and 17,659,185 Transactions between them.
Thanks!
Thanks @DanC ! Saved me a lot of time.
I have a similar problem. Need to split my data into separate files by the state field. This would be easy except each file needs to have a header and trailer record. The trailer should contain a count of records within the file. Not sure if this is possible but would like to avoid saving the workflow 50 times to account for each state. Currently the workflow builds a file that looks like this.
Example:
HDR#############
BDY#############|| CA
BDY#############|| NY
BDY#############|| AL
TRL#############[count]
Any suggestions?