I want to provide 5 counts to SSRS from a conditional count on a column. For instance, suppose the column held the color of a product -- green ,blue, red and yellow. What I would like to do is return the count of each in a single query.
Although I can accomplish getting this done using a case statement:
Select
COUNT(*) 'Count',
case
When Color = 'BL' then 'Blue
When Color = 'RD' then 'Red
When Color = 'YL' then 'Yellow
When Color = 'GR' then 'Green
Else 'All Others'
End as Payment
From COLORS(NoLock)
Group by
case
When Color = 'BL' then 'Blue
When Color = 'RD' then 'Red
When Color = 'YL' then 'Yellow
When Color = 'GRthen ‘Green’
Else 'All Others'
End
When I use the dataset is SSRS, all I get is the a single count. I don't want to create 4 dataset queries as I'm actually selection the records by the parameters start and end date and I would end up having 5 sets of date parameters.
colors
and then theall others
value. Can you clarify what you are attempting to do? – Taryn