Forum Discussion
What to do when Merge JoinKind.RightAnti returns NO rows?
- 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"
It depends on your query code.
Suppose your "Merge1" query is only the merge and nothing else::
= Table.NestedJoin(Table1,{"ID"},Table2,{"ID"},"Table2",JoinKind.RightAnti)
And if your followup query refers to Merge1[Table2](0), then you can use try .. otherwise and have an empty Table2 returned in case of an error.:
= try Merge1[Table2]{0} otherwise Table.SelectRows(Table2, each false)- rjrn8 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
- MarcelBeug8 years ago
Community 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