Forum Discussion

rjrn's avatar
rjrn
Frequent Visitor
8 years ago
Solved

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 ...
  • MarcelBeug's avatar
    MarcelBeug
    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"