Use vlookup with Linq and TWO DATATABLES

I am trying to do a vlookup through a linq.

I have two tables.

Both tables contain the column “ACCOUNT”

dt1
Account | Concept

dt2
Account | Description (this column has a position 27)

I want through the account to bring the concept of each account that concept is in my dt2 and if they do not match, leave a blank space or put a word for example “Does not match”

Linq is required because both documents have 600000 data

I hope it helps me

IN MY DT1 I HAVE THE COLUMN “Concept” in position 37 and those results of concepts must be placed here

Can you provide sample data tables (with random content inside them) so we can better visualize what are your requirements?

Best,
Charbel

Seems similar to this topic.

Hi ,

If the input is basically from the Excel as input , you can try by vlookup in one cell and auto fill range.

image
That is my dt2, and this account number will be related to my dt1 since they have the same accounts, and if they match, you must bring the Concept of my DT2, and if it does not match, leave that space blank.

DT1
image

IN THIS COLUMN THE CONCEPT OF MY DT2 MUST BE TRANSFERRED IF IT MATCHES

image
CONCEPT TO BE TRANSFERRED IF THE ACCOUNT MATCHES

help me please

Let’s make a sample case:
Before:
dt1:
image
dt2:
image

After:
dt1:
image
dt2 remains the same

It is just to confirm everything so we don’t get confused when we start implementing the code.

Best,
Charbel

Sorry for the delay, that’s right, so should the result be

help me , please

help me, please

Took me some time, thanks for waiting :), here is my workflow:

11-11-2021- Joining dts using LINQ.xaml (7.2 KB)

Sample data:
Joining dt using LINQ.xlsx (8.8 KB)

Looking for more optimizations (if possible).

Best,
Charbel

I have this problem


because “Account” in both datatable have a alot of numbers for example

Account
991546784670

Help me please!

1 Like

When Change toInt32 to int64 i have this error

1 Like

Okay, so I think the int32 issue was solved, try unhiding all the rows in the excel file, or try writing the final answer in a new excel file or a new sheet.