Hi All,
Below is LINQ, please advise me how to use not condition for the same query.
I want Opportunity ID from d1 which is not equal to Opportunity ID in d2
(From d1 In io_dt_PastClosedDate.AsEnumerable
Join d2 In io_dt_PastProposalSubDate.AsEnumerable
On d1(“Opportunity ID”).ToString Equals d2(“Opportunity ID”).ToString
Select d1).CopyToDataTable
Thanks in advance
Rushi
@ppr need help!
Gokul001
(Gokul Balaji)
November 9, 2022, 7:28am
2
Hi @Athawale_Rushikesh
You can try with Join Data Table activity
Regards
Gokul
HI @Gokul001
Join Data Table activity is not returning correct records, instead few records are getting repeated in OP Data table.
Pleas suggest solution in the form of Linq.
Thanks
Gokul001
(Gokul Balaji)
November 9, 2022, 7:41am
4
I don’t think so it is happening, Its Wired, Can you share the sample input excel file
Gokul001
(Gokul Balaji)
November 9, 2022, 8:16am
5
HI @Athawale_Rushikesh
Check out this XAML File
ForumReference.xaml (6.9 KB)
Try with this expression
DtInput2.AsEnumerable.Except(DtOutput.AsEnumerable,DataRowComparer.Default).CopyToDataTable
Regards
Gokul
Dawodm
(Mahmoud Dawod)
November 9, 2022, 8:33am
6
Hi @Athawale_Rushikesh
Join operator is to join two tables using a key (one column or different columns together).
I think what you want to do is merge, not join.
Join is always to get the rows from two tables with basis on a key.
Merge is to get all rows from both tables together in one table.
If you have the table, it would be easier to show you how to do that!
My first idea is to merge and then to delete the duplicate rows!
ppr
(Peter Preuss)
November 9, 2022, 8:39am
7
We do have 3 categories: Joining Data, hasMatch Check, Lookup Data when it is about bringing data together. Your case look like a hasMatch Check, where the result is denied.
Give a try at:
(From d1 In io_dt_PastClosedDate.AsEnumerable()
Let lid = d1("Opportunity ID").ToString().Trim()
Where Not io_dt_PastProposalSubDate.AsEnumerable.Any(Function (d2) d2("Opportunity ID").ToString().Trim().Equals(lid))
Select r = d1).CopyToDataTable
@ppr
Thanks as always for providing the exact solution
system
(system)
Closed
November 12, 2022, 3:53pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.