Lookup two Datatable Linq

Hi

How to lookup Datatable in linq Uipath

i have standard data file into lookup the input data file fill…

if i have to input file cell is empty or null value in that lookup to standard data file as on… i will check each cell and each row…

Dynamic Condition

Input file…
image

Lookup_Value

Expected output…

File attached for reference…

Data.xlsx (49.7 KB)

Small amount of rows and columns shared…

Thanks
Shyam

Hi @Shyam_Pragash

You can use the joins instead of lookup.

  1. Need to put the Input file datatable at first and
  2. Lookup value datatable at 2nd
  3. Do the left join

you will get all the required column into the expected output table and from there you can use dataview to get the required column only

Hi @Sanjit_Pal

In that input sheet some cell are empty…

i have check with lookup sheet based on the “Customer Id” is Unique on both sheet…

Fill the empty cell from the lookup sheet value…

Refer: Expected output sheet.

Thanks
Shyam

Hi @Shyam_Pragash

Use the attached file.
LeftJoin.zip (25.6 KB)

Hi @Sanjit_Pal

The code is working…

Output file (text.xlsx) your shared. in zip. totally different from i expected output.

Please refer the your output and i shared expected output.

Thanks
Shyam

@Shyam_Pragash Once the join is done, you can get the required column using that method and also rename the column as per your requirement

Hi @Sanjit_Pal

i have more than 130+ Columns and 2000+ rows in input file…

Input Sheet one this {Product ID,Category,Sub-Category,State,Postal Code,Region,Product Name} Columns… compare (Check) with

lookup Sheet those {Product ID,Category,Sub-Category,State,Postal Code,Region,Product Name} Columns

i have to check each columns one by one if the cell is empty check the lookup sheet the value is avaiable fill the data in inputsheet

Please refer the excel sheet.

Thanks
Shyam

@Shyam_Pragash correct me if I am wrong as I can understand you have the Customer_Id is unique in both the files.

if yes, suppose you have the Customer Id as CG-12520 and for this Customer_Id the Product _ID, Category and State are blank in the InputFile on the other hand for the same Customer_Id in the lookup file Product _ID, Category and State data is there, so by doing left join based on the Customer_id a new table will get prepared in which the columns of lookup file will also get added where you can see all the available data.

Thanks & Regards,
Sanjit

Hi… @Sanjit_Pal

Yes. this is the process…

@Shyam_Pragash same process I have created and given to you and you can modify it as per your requirement

Regards,
Sanjit Pal

Hi @Sanjit_Pal

ok… Thanks

share me on linq query.

Thanks
Shyam

@Shyam_Pragash this will help you to do the left join using linq