Data Collection Errors

I am sure this is an easy fix, but I’ve just started using the report module and when I try and use a table I keep getting a data collection error : Wrong number of vaules for a row. Expected 4. I cannot provide the query I am using for the source but it is like this
select count(table.part_sn) as ‘Count’,
part_status as ‘Status’,
check_description as ‘Check’,
check_type,
design as ‘Design’
from table

Does this query work outside of the reporting module? I don’t think it will. You are selecting the count, which will return 1 result, and then individual values, which will return many results.

Actually it does work when I include the group statement. I don’t know why this caused the data collection error though.
I ended up using something like this:
SELECT design as 'Design ‘,
test_running as ‘Test’ ,
config as ‘Part Config’,
count(*) as ‘Total’,
count(case
when status=‘WIP’
then 1
else null
end) as ‘In Test’,
count(case
when status=‘Pass’
then 1
else null
end) as ‘Pass’,
count(case
when status=‘Fail’
then 1
else null
end) as ‘Fail’,
count(case
when status’=‘Hold’
then 1
else null
end) as ‘Waiting’

from inventory
where test is not null
group by design,test,config
And this is working like I need it.