I have to split the single output excel file to multiple excel by filtering the column

Hi team,

Below is my output excel file

Output (8).xlsx (8.5 KB)

In this excel based on the column OperatingUnit it has to divide into seperate files

For example Last 3 digits in the operatingUnit column i.e “PUR” rows should shift to one excel with same headers
in the same way for PR and CHL into two different excel

Thanks
Likitha

Hi @vinjam_likitha

You can do this using Filter Datatable

  1. Use Read Range activity and this will output a datatable let say dt_Master
  2. Now create another datatable variable let say dt_temp
  3. Use Filter Datatable and in the filter configure as Operating Unit as in Column and in the operation EndsWith as “PUR”
  4. Now the Input Datatable is dt_Master and Output Datatable is dt_temp
  5. Use Write Range activity and pass the dt_temp
  6. Repeat the same for the “CHL” as well

Hope this helps you

Thanks,
Srini

Hi @vinjam_likitha

Another way is as below

  1. Create a string arrayVariable let say arrReports
  2. Use Assign activity and write as arrReports = {“PUR”, “CHL”}
  3. Use For Each activity and pass the arrReports
  4. Now, Inside the For Each activity place Filter Datatable activity
  5. Configure Column as “OperatingUnit” and operation is EndsWith and value is CurrentRow(“OperatingUnit”).ToString
  6. Pass the InputDatatable as dt_master and output Datatable as dt_temp
  7. Next activity inside the ForEach place Write Range activity and pass the path and in addition to that add CurrentItem(“OperationUnit”).ToString + “.xls” which will give PUR / CHL to the filename

Hope this may help you

Thanks,
Srini

@vinjam_likitha

separated with different sheets…

This Flow will create 3 different sheets with PUR,CHL,PR
Each sheet will have respective sheet name data
have shown in below image for PUR sheet