SSIS and add totals in the column in excel file

Spunny 366 Reputation points
2022-02-01T17:44:41.267+00:00

Hi All,
We have excel files that we get from vendor. The file has 4 columns. In that we need to get total for each column (for 2 columns). The total for each column should be as last row. For example:

Excel File:
column1 column2 column3 column4
1 xx 40.00 41.30
2 yy 50.50 51.00

I need to update excel file like this:
column1 column2 column3 column4
1 xx 40.00 41.30
2 yy 50.50 51.00
90.50 92.30

and save the same file.

Is it possible.
Thanks

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,702 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 41,491 Reputation points
    2022-02-02T02:36:29.703+00:00

    Hi @Spunny ,

    Why not just edit the excel to get the total? I think it could be more easier compared with SSIS.

    add-a-total-row-to-a-table-9885a56c-51b5-487a-a168-054afd034631

    If you want to do that in SSIS, you may use script task for a try which will be a little complex.

    add-subtoal-as-new-row-in-data-flow-task-ssis

    Regards,

    Zoe


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. Spunny 366 Reputation points
    2022-02-02T15:57:38.04+00:00

    Hi Zoe,
    Thanks For response. We get multiple files from vendor without sums daily. We need to sum on certain columns in each file and email them every day. we are manually opening each file and doing sums, saving it and emailing. It's getting tedious. So, we want to automate the process.

    0 comments No comments

  3. Spunny 366 Reputation points
    2022-02-02T16:02:28.613+00:00

    I need code in activex script task to loop through excel files, open each file, sum on certain column and add as total to last row and save the file.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.