4 Replies Latest reply on Jul 7, 2016 12:01 PM by kettan

    Multi value parameter separated by a comma delimitter

    karen N

      Hi,

       

      Tableau 9.2.6

      Requirement:

      We have an object named ID_OBJECT and the data needs to be filtered for the id's entered in the Parameter separated by a comma delimitter.

      ID_OBJECT contains numbers from 1 to 1000000.

       

      I have taken a string parameter where I need to enter multiple value separated by a comma delimitter.

      Ex: 6671, 102631,7789

      my requirement is that the data need to filtered for the given ID's.

       

       

      I tried by using calcualted field 'contains([parameter], STR([ID_OBJECT]))' and used it in the filters section by setting it to true but when I enter 6671 in parameter it pulls up the below ID's

       

      1

      67

      71

      667

      6671

       

       

      Please suggest if there is any workaround to achieve this in Tableau.

        • 1. Re: Multi value parameter separated by a comma delimitter
          swaroop.gantela

          Karen,

           

          Yours was an innovative approach, but I fear the culling down to the correct IDs

          will require quite a bit of parsing (please see an example in the attached, Sheet2).

           

          Did want to seek clarification on how your users will be entering in desired IDs.

          Will they submit to you lists of comma separated strings that you will incorporate into parameters?

          Will there be of a predetermined amount IDs per line?

          If these are known in advance, the parsing, though multistep, could work.

           

          If the end goal is to have a user enter into a textbox the list of strings,

          then I think using the "Multiple values (custom list)" option of the

          filter interface should work (Sheet1).

           

          210347filt.png

          • 2. Re: Multi value parameter separated by a comma delimitter
            karen N

            Thanks swaroop for working on it....

            Will they submit to you lists of comma separated strings that you will incorporate into parameters? -No

            Will there be of a predetermined amount IDs per line? -No

             

            The requirement is the user will be entering the values separated by a  comma delimiter in the parameter (approximately 1000 id's) and they will be entering the random numbers. I know it's a challenging requirement and didn't find anything so far to resolve this in tableau...Let me know if you find any..

            • 3. Re: Multi value parameter separated by a comma delimitter
              Dmitry Chirkov

              At some point I acheved this by going Custom SQL route and pushing parameter value though a function that returns a table (something like this). Then, use that 'table' in IN clause.

               

              I'd have to agree with Swaroop though - "Multiple values (custom list)" filter is much cleaner.

              • 4. Re: Multi value parameter separated by a comma delimitter
                kettan

                Solution A:  Calculation with Parameter

                Bracket parameter and field with commas (","):

                 

                CONTAINS(","+[PObject_ID]+",", ","+STR([Id Object])+",")
                

                 

                 

                Solution B: Quick Filter > Multiple Values (Custom List)

                If you filter on many Id Objects at the same time, pasting values into a multiple values custom list seems to me the most practical as already mentioned by swaroop and Dmitry :

                paste multiple values.gif