How do I filter on a list?

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

I have taken all the dividend-paying stocks and used k-means to assign them to clusters.  Now I would like to use a list of my personal stocks to see which clusters my stocks are in. I see a  filter operator to filter a single selection like on cluster_4 but I want to filter on a LIST no a single variable.

In SQL it would look like this:

Select * where StockSym in {XOM, PRU, CVX, SPG …..} 

Is there an operator I can use to filter based on my list?

Best Answer

  • rfuentealba
    rfuentealba New Altair Community Member
    Answer ✓
    Yes, it's actually called Filter Examples.

    Since you are trying to do a SELECT with an OR, on the bottom left corner of the Filter Examples configuration you can select "any" of these, not "all".

    If by any chance you have an actual list as an example set, you can use a "Join", and make it an "Inner" join.

Answers

  • rfuentealba
    rfuentealba New Altair Community Member
    Answer ✓
    Yes, it's actually called Filter Examples.

    Since you are trying to do a SELECT with an OR, on the bottom left corner of the Filter Examples configuration you can select "any" of these, not "all".

    If by any chance you have an actual list as an example set, you can use a "Join", and make it an "Inner" join.

  • Columbia
    Columbia New Altair Community Member
    Thank you.  The second suggestion did the trick.  I joined my stock list with the cluster output to get the results I wanted.

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.