@Override
	protected void writeRecords(CompanyCollection companies, CsvWriter csvWriter, Boolean isIncremental) throws IOException
	{
		csvWriter.writeRecord(FACT_FILE_HEADERS);
		csvWriter.flush();
		for(Company c : companies)
		{
			try
			{// "VALUE", "TIME", "ACCOUNTS (GEN_ID)", "DATASET (GEN_ID)"
				// Agresso Data
				writeFactDoubleCollection(csvWriter, c.getAverageDaysToPaymentCollection(), c.getId(), DATASET_AVERAGE_DAYS_TO_PAYMENT_CODE, isIncremental);
				writeFactDoubleCollection(csvWriter, c.getOpenBalanceCollection(), c.getId(), DATASET_OPEN_BALANCE_CODE, isIncremental);
				writeFactDoubleCollection(csvWriter, c.getTotalSpendCollection(), c.getId(), DATASET_TOTAL_SPEND_CODE, isIncremental);
				//D&B Data
				if(c.hasDunnBradstreetData())
				{
					// Rating ( Risk Indicator )
					for(DnBRating r : c.getDunnBradstreetData().getDbratingHistory())
					{
						if(isIncremental==false || r.getIsCommitted()==false)
						{
							csvWriter.writeRecord(new String[] { String.valueOf(r.getRiskIndicator()), getFormattedStringForDate(r.getDate()), c.getId(), DATASET_RISK_CODE });
							csvWriter.flush();
							r.setCommitted();
						}
					}
					// Failure Risk
					writeFactIntegerCollection(csvWriter, c.getDunnBradstreetData().getFailureRiskScoreHistory(), c.getId(), DATASET_FAILURE_RISK_CODE, isIncremental);
					// Failure Risk Percentile
					writeFactIntegerCollection(csvWriter, c.getDunnBradstreetData().getFailureRiskPercentileHistory(), c.getId(), DATASET_FAILURE_RISK_PERCENTILE_CODE, isIncremental);
					// Payex
					writeFactIntegerCollection(csvWriter, c.getDunnBradstreetData().getPaydexScoreHistory(), c.getId(), DATASET_PAYDEX_CODE, isIncremental);
					// Payex Norm
					writeFactIntegerCollection(csvWriter, c.getDunnBradstreetData().getPaydexNormHistory(), c.getId(), DATASET_PAYDEX_NORM_CODE, isIncremental);
					// Credit Delinquency Score Percentile
					writeFactIntegerCollection(csvWriter, c.getDunnBradstreetData().getCreditDelinquencyNationalPercentileHistory(), c.getId(), DATASET_CREDIT_DELINQUENCY_SCORE_PERCENTILE_CODE, isIncremental);
					// Max Credit Recommendation
					writeFactMoneyCollection(csvWriter, c.getDunnBradstreetData().getMaximumCreditRecommendation(), c.getId(), DATASET_MAX_CREDIT_RECOMMENDATION_CODE, isIncremental);
					// Cash and Liquid Assets
					writeFactMoneyCollection(csvWriter, c.getDunnBradstreetData().getCashLiquidAssetsHistory(), c.getId(), DATASET_CASH_AND_LIQUID_ASSETS_CODE, isIncremental);
				}
				// Experian Data
				if( c.hasExperianData())
				{
					// Delphi
					writeFactIntegerCollection(csvWriter, c.getExperianData().getDelphiScores(), c.getId(), DATASET_EXPERIAN_DELPHI, isIncremental);
					// Delphi Industry Average
					writeFactIntegerCollection(csvWriter, c.getExperianData().getDelphiScoresIndustryAverage(), c.getId(), DATASET_EXPERIAN_DELPHI_INDUSTRY, isIncremental);
					// Days Beyond Terms
					writeFactIntegerCollection(csvWriter, c.getExperianData().getDaysBeyondTerms(), c.getId(), DATASET_EXPERIAN_DAYS_BEYOND_TERMS, isIncremental);
					// Dats Beyond Terms - Industry Average
					writeFactIntegerCollection(csvWriter, c.getExperianData().getDaysBeyondTermsIndustryAverage(), c.getId(), DATASET_EXPERIAN_DAYS_BEYOND_TERMS_INDUSTRY, isIncremental);
				}
			}
			catch(IOException e)
			{
				logger.severe(e.getMessage());
			}
		}
	}