LINQ - Multiple CONDITIONAL Unique Identifier Matching Two Data Tables

Good day fellow UiPath developers,

Is it possible to implement a LINQ code of matching two data tables with multiple conditional unique identifier columns?

This is the conditional unique identifier matching:

  • msisdn (dt_Change) = ACCTNUM (dt_NoKey) AND
  • date (dt_Change) <= SETTLEMENTDATE (dt_NoKey) AND
  • merchant (dt_Change) = MERCHANTNAME (dt_NoKey) AND
  • amount (dt_Change) <= BILLINGAMT (dt_NoKey)

These are the input data tables:

This is the expected output:

As you noticed those transaction rows that does not met the requirements has the columns
ACCTNUM,SETTLEMENTDATE,MERCHANTNAME, and BILLINGAMT returned as “#N/A”.

Is this possible to implement in LINQ? Any help would be much appreciated. Thank you in advance!

Regards,
Anthony Jr.

Hi @anthonyjr

Please clarify

For the the third row there are three matches which satisfy all the conditions

Why have you selected only one row?

Hello sir @kumar.varun2

Sorry I was careless on the output, this should be the expected output right?
image