Search code examples
reporting-servicesssrs-2008

How to avoid summing of numbers in report model in SQL Server Reporting Services


In a report model I have some entities which have attributes which are integers (set to integer datatype) but should not be summed or aggregated in any way. For examples ID's. But when I create reports with the wizard, sometimes the report builder will try to sum the values even though it doesn't make sense to sum ID's. For example let's say I have a list of cars sold in a month. In january I've sold 2 cars, one with the ID 101 and one with the ID 210. In report builder I will then - when using the wizard - get the number 311 for the summed values. I can remove it afterwards, but I would like this to not happen at all (since the end-users will be confused)

I need a way to say to the report model: This is an integer, but it is not really a number you should sum up


Solution

  • Well the wizard isn't perfect as you've found out. It does it's best in trying to figure out what to do. All that you can really do is remove =Sum(carID.value, "datasetname") when it automatically puts it there. Or if you don't need to sum anything at all delete the footer of the table. A workaround perhaps would be to do a Convert in your SQL to make your ID's a varchar.