Be sure to different between sub-total lines interspersed with the complete lines in the transactions tables. Be sure to omit sub-total lines from the extraction.