A computer-implemented method determines a document flow of documents stored in a documents database. Data on the documents including relational data may be stored in the documents database. The method includes creating a database view of the document flow of the documents stored in the documents database. Creating the database view of the document flow includes calculating a document-document relationship on the fly by retrieving references from the original documents stored in the documents database. A SQL select statement is used to calculate the document-document relationship.