Operator to "Where not in " clause

morrgray
morrgray New Altair Community Member
edited November 2024 in Community Q&A

Hi, I am looking for a operator that can perform " where not in  ". I have two data sets I want to have rows from first data set which not contain in the seond data set by compare two date columns like :

select * from dataset1

where  dataset1.date not in (select date from dataset2)

How can I do it in Rapidminer? 

Thanks in advance

Tagged:

Best Answers

  • kypexin
    kypexin New Altair Community Member
    Answer ✓

    Hi @morrgray

     

    It's 'Set Minus' operator which should do the trick, it returns those examples of the ExampleSet whose IDs are not contained within the other ExampleSet. But also note that before applying it you also have to use "Set Role" operator on both datasets and convert those date fields into 'id' type.

  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Answer ✓

    Hi,

     

    Vladimir is exactly right, Set Minus is meant for this in a "set operation" way.

     

    If you prefer a more database-like solution or can't set the IDs, do a Left Outer Join with the Join operator and then filter the records where the attributes from the second dataset are not missing.

     

    Regards,

    Balázs

Answers

  • kypexin
    kypexin New Altair Community Member
    Answer ✓

    Hi @morrgray

     

    It's 'Set Minus' operator which should do the trick, it returns those examples of the ExampleSet whose IDs are not contained within the other ExampleSet. But also note that before applying it you also have to use "Set Role" operator on both datasets and convert those date fields into 'id' type.

  • BalazsBaranyRM
    BalazsBaranyRM New Altair Community Member
    Answer ✓

    Hi,

     

    Vladimir is exactly right, Set Minus is meant for this in a "set operation" way.

     

    If you prefer a more database-like solution or can't set the IDs, do a Left Outer Join with the Join operator and then filter the records where the attributes from the second dataset are not missing.

     

    Regards,

    Balázs