Assemble Jobs calculations problem
Posted: Sun Aug 04, 2024 8:32 pm
Hi all,
When I submit a job folder, it has a csv file which will have a different number of rows for each submission. The number of rows determines how many files will be generated.
Down the line I need to assemble those files back into a folder.
I'm using a custom scheme. Job identifier is set to [Job.IsFile], and then the Number of files property needs an entry.
My attempt at a solution is to convert the original csv to a text file by simply renaming the file, then I use the "CountRows" element to count the rows. This adds a Private Data Key of "RowCount", which I would then submit to Assemble Jobs as the Number of files.
[Job.PrivateData:Key="RowCount"]
However, the csv has a header row in it, which increases the number of rows by 1, making the actual job count 1 too high. To account for that, I used a Calculation to remove 1 from the RowCount:
[Switch.Calculation:Expression="[Job.PrivateData:Key="RowCount"]-1"]
It returns the correct number, but this doesn't work in the Number of files field.
When I say "doesn't work", I mean that when I use the calculation, it does not actually assemble the jobs. For example if I have 10 files, it will simply push those 10 files on to the output folder and not assemble them into a folder.
If I type "10" into the Number of files field inline then it works as expected, correctly combining those 10 files into a new job folder.
What are my options for grabbing that number dynamically in a way Assemble Job doesn't object to?
When I submit a job folder, it has a csv file which will have a different number of rows for each submission. The number of rows determines how many files will be generated.
Down the line I need to assemble those files back into a folder.
I'm using a custom scheme. Job identifier is set to [Job.IsFile], and then the Number of files property needs an entry.
My attempt at a solution is to convert the original csv to a text file by simply renaming the file, then I use the "CountRows" element to count the rows. This adds a Private Data Key of "RowCount", which I would then submit to Assemble Jobs as the Number of files.
[Job.PrivateData:Key="RowCount"]
However, the csv has a header row in it, which increases the number of rows by 1, making the actual job count 1 too high. To account for that, I used a Calculation to remove 1 from the RowCount:
[Switch.Calculation:Expression="[Job.PrivateData:Key="RowCount"]-1"]
It returns the correct number, but this doesn't work in the Number of files field.
When I say "doesn't work", I mean that when I use the calculation, it does not actually assemble the jobs. For example if I have 10 files, it will simply push those 10 files on to the output folder and not assemble them into a folder.
If I type "10" into the Number of files field inline then it works as expected, correctly combining those 10 files into a new job folder.
What are my options for grabbing that number dynamically in a way Assemble Job doesn't object to?