Combine generated documents into one file

Is there a way to generate documents based on criteria (I can do this) and then combine all of the ones that meet a certain criteria (let's say site name = x and department = y).

So for all documents where site name = x and department = y, combine into one pdf file?

Answers