Data table :- Create separate excel tabs based on particular column values and update their row values

Requirement :

How to create separate excel tabs based on values available in “SAPSystemName” column and update their row values in to their respective sheets

Input DT file:
Consolidated_input.xlsx (9.8 KB)

Expected output:
ConsolidatedExpected.xlsx (13.8 KB)

Assign Activity
TableList | DataType: List(Of DataTable) =

dtConsolidated.AsEnumerable.GroupBy(Function (x) x("SAPSystemName").toString.Trim).Select(Function (x) x.CopyToDataTable).ToList

the loop over TableList and write each datatable to excel

for the sheetname you can use: yourLoopVar.Rows(0)(“SAPSytemName”).toString.Trim

@Sathish_Kumar_S

Excel Preocess Scope
Use Excel File
Assign:

List=io_dt_TransactionData.AsEnumerable() _
    .Select(Function(row) row.Field(Of String)("YourColumnName")) _
    .Distinct() _
    .ToList()

For each
Filter Activity

Copy Paste Range activity:
Source:Your Sheet Name
Destination:currentText
Filter–>Removing Filter
This is the high level code for your Process

1 Like


Getting this error

trace and inspect the loop variable

instead of column name the Index number worked " currentDataTable.Rows(0)(1).ToString "

Also refer to your typo where the s from system is missing sytem vs system

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.