writing data from Table to Excel files in Loop based On a condition

  • HI,

    I am trying to load the data from table to Excel files.

    I have 5 folders, each folder has an exel file called "Excel Upload.xlsx".

    I need to write data into each of the excel file(into one of the sheet) based on one condition.

    If the prefix of one of the ID in the table matches prefix of folder name then write that data back to that particular folder.

    Ex: ID: "GARNIER SHAMPOO" then write back to \\servername\e$\Data\MDP_76_02\Inbound\Excel Upload\Garnier\excel upload.xlsx

    I am facing issues while doing this, Can any one please provide me an approach.

  • Data Flow Task containing:

    1. OLE DB Source that selects the data you need to export as a single resultset, i.e. a SELECT statement

    2. Conditional Split that evaluates the ID column and creates 5 output streams based on the 5 folder prefixes you mentioned

    3. Have an Excel Destination connected to each of the output streams that writes the data into the Excel sheets you mentioned.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • Thank you for the reply.

    Since I am writing to 5 Different folders, I need to create 5 differnt Excel destination connections.

    I would like to have a solution to get a foldername dynamically and match to prefix of the ID. I don't want to create multiple Excel connections. Can you please give a solution to achieve this.

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

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