Forum Discussion
rjrn
8 years agoFrequent Visitor
What to do when Merge JoinKind.RightAnti returns NO rows?
Hi all! I am trying to make a Merge JoinKind.RightAnti on 2 queries to get only the rows that are in the 2nd query. Most of the times it works, since there ARE rows in the 2nd query that ARE NOT ...
- 8 years ago
An empty Table2 means Table2 without records.
So you have the columns and their data types, so the rest of your code runs without errors.My solution translated to your query (not tested, but it should be OK):
let Source = Table.NestedJoin(CW_opps,{"Opportunity Id18"},PW_opps,{"Opportunity Id18"},"PW_opps",JoinKind.RightAnti), PW_opps1 = try Source{0}[PW_opps] otherwise Table.SelectRows(PW_opps, each false), #"Removed Columns" = Table.RemoveColumns(PW_opps1,{"Proposal Due Date","Stage"}) in #"Removed Columns"
rjrn
8 years agoFrequent Visitor
Thank you!
Here is the Merge1:
let
Source = Table.NestedJoin(CW_opps,{"Opportunity Id18"},PW_opps,{"Opportunity Id18"},"PW_opps",JoinKind.RightAnti),
PW_opps1 = Source{0}[PW_opps],
#"Removed Columns" = Table.RemoveColumns(PW_opps1,{"Proposal Due Date","Stage"})
in
#"Removed Columns"Sorry for the stupid questions, but what do you mean with "have an empty Table2 returned in case of an error"?
Regards, RN
MarcelBeug
8 years agoCommunity Champion
An empty Table2 means Table2 without records.
So you have the columns and their data types, so the rest of your code runs without errors.
My solution translated to your query (not tested, but it should be OK):
let
Source = Table.NestedJoin(CW_opps,{"Opportunity Id18"},PW_opps,{"Opportunity Id18"},"PW_opps",JoinKind.RightAnti),
PW_opps1 = try Source{0}[PW_opps] otherwise Table.SelectRows(PW_opps, each false),
#"Removed Columns" = Table.RemoveColumns(PW_opps1,{"Proposal Due Date","Stage"})
in
#"Removed Columns"- rjrn8 years agoFrequent Visitor
THANK YOU!
This worked like a charm!
My very best, RN