group totals don't equal sum of group items

  • OK - I've tried everything I can think of to fix this but nothing is working. Here's the issue; I have created a report that is sums building square footage grouped by market. the client wants the excel export in whole numbers so I put in a round function, with and w/o midpointrounding.away fromzero and then tried (format N0) each returns the whole number. So far so good. However when I total the group the value is sometimes spot on and sometimes off because of the rounding. I tried rounding the group total, etc., but no combination of rounding/formattting seems to work. I thought of going into the underlying sql and create a new dataset for the totals, but not sure that wouldn't have the same issue, besides it is a pain given all the colums subtotals and totals I am dealing with. Anyone else encountered this? How did you solve it?

    Thanks, John

  • jgluszak (3/19/2013)


    OK - I've tried everything I can think of to fix this but nothing is working. Here's the issue; I have created a report that is sums building square footage grouped by market. the client wants the excel export in whole numbers so I put in a round function, with and w/o midpointrounding.away fromzero and then tried (format N0) each returns the whole number. So far so good. However when I total the group the value is sometimes spot on and sometimes off because of the rounding. I tried rounding the group total, etc., but no combination of rounding/formattting seems to work. I thought of going into the underlying sql and create a new dataset for the totals, but not sure that wouldn't have the same issue, besides it is a pain given all the colums subtotals and totals I am dealing with. Anyone else encountered this? How did you solve it?

    Thanks, John

    The problem is not in the sql but with your client. They want numeric calculations presented as integers and then don't understand why the totals are off.

    Maybe you need to use SUM(CEILING(SquareFootage)). In other words force your calculations to be incorrect so the totals will match. It probably comes down to accurate the report needs to be. If close is ok then something like that should work.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply