Save analysis in the database