4 Replies Latest reply on Jun 19, 2013 12:32 PM by Alex Kerin

    Select subset of IDs from database source

    Ian Pytlarz

      I have an Oracle database as my data source, and a list of IDs of people I would like to be included in a report I'm making. I can't seem to find an easy way to do this filter, other than manually going through the list of every ID in the database and checking off just the 4700 or so IDs that I want, which can't be right. Am I missing some obvious option somewhere?

        • 1. Re: Select subset of IDs from database source
          Alex Kerin

          If your list was in the same Oracle DB (or was somehow generated from it), you could filter using that of course. Under the assumption it's not, you can use data blending to exclude the unwanted IDs.

           

          Attached there is an workbook with an Excel main source, another Excel file that has a subset of customer IDs, and a calc that simply looks for the match of the ID in both sources. With the view shown you can quickly exclude those that don't match. You could also set this to context (to filter prior to any other query), and to global so that every sheet uses the filter. exclude.png

          • 2. Re: Select subset of IDs from database source
            Ian Pytlarz

            Worked like a charm, thanks!

            • 3. Re: Select subset of IDs from database source
              Robert Morton

              Alex Kerin gives the best answer - data blending gives you the most flexibility for updating your list of IDs to filter (include) by simply editing the Excel spreadsheet that is your secondary data source.

               

              However I'd like to remind folks that you can paste in a long list of values to filter directly into the Filter dialog.

               

              1. Open the file containing your list of IDs to keep, and copy its contents. Copy only the data, not the column header row if there is one.
              2. Switch to Tableau.
              3. Drag the dimension of interest to the Filters shelf.
              4. Choose the middle radio button option, "Custom Value List".
              5. Click the text entry box (faint yellow background) and paste your list of IDs directly into the filter box. All IDs will then be placed in your custom value list. Click OK to accept the filter criteria.

               

              I hope folks find this useful,

              Robert

              • 4. Re: Select subset of IDs from database source
                Alex Kerin

                That's really cool Robert, I had no idea it would accept multiple lines.