Home Forums SQL Server 2008 SQL Server 2008 - General SSIS not producing information from my COMPUTE BY clause when exporting to Excel RE: SSIS not producing information from my COMPUTE BY clause when exporting to Excel

  • J M-314995 (3/5/2013)


    When I run a script that uses COMPUTE BY in SSMS I get the desired results. When I try and create an SSIS package to export out to Excel, it completely ignores the COMPUTE BY clause. I need to do a subtotal by a certain group but I don't need to sum any of the columns.

    I've been reading about GROUP BY (ROLLUP) but I can't get that to work. It wants me to add every single column name into the GROUP BY clause which of course ruins how I want the data to look when it's exported out to Excel.

    Here's a sample of how I'd like the data to look like once it gets to Excel...

    This is where I'd want a subtotal on the post_amt on every change in admit_svc_code. Like I said this works just fine if I use COMPUTE BY within SSMS but that line is ignored when I try and export it out to Excel. I know how to make this work if I export the raw data into Excel but I'd like the data to already look like that from the SSIS export.

    How about using SSRS to export data into the excel file? SSRS supports sub-total on which columns you want.