How to Read other excel files If company code more than one in excel

i have input excel file sap dump, in that company code column
like 1000,2000

here example is 1000 ,2000 is there. if company code is not same (unique) then i have to read other excel files in region folder

how to write condition ?

your requirement is not fuly clear. Can you elaborate on some more details? Thanks

Genrally only one code in the company code column , if two different code(Not Unique) is there then i have to read other folders otherwise need not

a simple check could be:

isUnique =

dtData.AsEnumerable.Where(Function (x) x("Vendor").toString.Trim.Equals(YourVendorCode)).Select(Function (x) x("Company Code").toString.Trim).Distinct().Count =1

in case of you need some statistic reports / helper lookup dictionaries

  • we can create it with the help of LINQ by grouping the data by Vendor

in case of you need a list with unique vendors / company codes

  • dtData.DefaultView.toTable(True,{“Vendor”,“Company Code”})

Hello @Anand_Designer,

You can use for each row, and then assign var(Company Code) and Var(Vendor). After that you can use If activity. Var Company Code = Var Vendor . If it is true then read an excel, if it is false, then it reads another excel file.

I hope it helps :slight_smile: