Iam using this below code for vlookup
(From row in dt_Lookup.AsEnumerable
Join main in dt_SourceTable.AsEnumerable on
row(“PO_NO”).tostring Equals main(“PO NO”).TOString
Select dt_sourceTableClone.rows.Add(main(PO NO),row(PO_NO),main(ITEM NAME),main(ITEM Desc),main(QTY Pending),)main(Invoice Qty)).copytoDataTable
It is giving lot of duplicates and when jam manually applying vlookup iam getting proper data
Anyone have any other linq query.
try using join datatable activity with left or right based on what you need
also if you need something better to show data and explain requirement…as you already mentioned query is not giving expected results it can be anythign you need
@Anil_G tried using join dataTable also getting the result but it is giving lot of duplicates…How can i use firstOrDefault method in that so that i can take only matching rows.
@Anil_G while applying vlookup for po number using join, instead of giving me 3 item name its giving me 6 items. Is there any alternate except vlookup as the volume of the data is high and i have also used vlookup activity but it is taking 15 minutes for the execution,because of high data volume.
@Anil_G do you have any other groupby code based on 2 column like if i have a PO NO column which contains same 3 PO NO’s but the ITEM Name of each PO NO will be unique.
Instead using formula or linq directly write the excel vlookup formula in thr first row then use auto fill range activity to fill the formula till the end
If you use lookup activity it would take time…but above mentioned is different…
Anyways …try this…but i see diplicate po numbers in both dt…not sure how you want it to be handled…if you want to use any other column as well add condition in if accordingly