/* Client Synopsis — fact sample / totals (DatawarehouseNCM) Quick check that FactClientSynopsis loaded. */ -- Detail sample SELECT TOP 100 f.CorpCode, c.FormalName, f.InOut, f.CashType, f.SumType, f.Amount, f.AsOfDate FROM dbo.FactClientSynopsis f LEFT JOIN dbo.DimCorpClient c ON RTRIM(c.CorpCode) = RTRIM(f.CorpCode) ORDER BY f.CorpCode, f.SumType, f.InOut, f.CashType; -- Totals by SumType / InOut / CashType SELECT f.SumType, f.InOut, f.CashType, COUNT(*) AS [RowCount], SUM(f.Amount) AS Amount FROM dbo.FactClientSynopsis f GROUP BY f.SumType, f.InOut, f.CashType ORDER BY f.SumType, f.InOut, f.CashType;