2 Replies Latest reply on Aug 6, 2018 12:18 AM by meenu choudhary

    Check if value is in a dynamic list

    yoav tepper

      Hey,

      I have some experience with Tableau and i am aware that (unfortunately) there is no such thing as an "IN" clause in Tableau.

      i work with a tricky data source (basically a complex initial sql query) and i want to check if a certain [Project] is in a certain [Project List].

      the thing is - the [Project List] changes over time - therefore i cannot use literal strings or "CASE" clauses, i need something that will always be according to the up-to-date list.

      any ideas?

       

      Thank you in advanced!

        • 1. Re: Check if value is in a dynamic list
          Ankit Bansal

          Yoav,

           

          You can do this by left join. So Let say you have primary data source as below:

          Project

          P1

          P2

          P3

           

          Your dynamic project list  table looks like this

          Project_List

          P1

          P2

           

          Now when you will join primary data source with project list as LEFT join , Your data will look like this:

           

          Project     Project_List

          P1               P1

          P2               P2

          P3               (NULL)

           

          Now you can check if project exist in list or not as:

           

          if  Not ISNULL(Project_List ) then 'project exist in list' else 'Project does not exist in list' end

           

          Hope it is clear.

          1 of 1 people found this helpful
          • 2. Re: Check if value is in a dynamic list
            meenu choudhary

            Hi Yoav,

             

            If both Project and Project List are coming from same source then you can use "CONTAINS" function.

             

            CONTAINS([Project ],[Project list]).

            1 of 1 people found this helpful