Fixed queries for RecordsByStage charts