2 Replies Latest reply on Jan 22, 2013 1:46 PM by Robert Morton

    Using a calculation to filter underlying data?

    db db

      We have some bad records in our data that we really don't want reflected on a workbook for a customer.


      Basically, without getting too specific, we are trying to remove a few negative numbers from a list of invoices, where it gets sticky is that we can't just remove the days affected or the entire list of negative numbers.


      I talked to our DB manager and was unable to get a view with the invoice numbers to possibly filter that way, any ideas?

        • 1. Re: Using a calculation to filter underlying data?
          Joshua Milligan



          It is difficult to give a specific answer to this, but in general, yes you can create a calculation to be used as a filter.  For example, you might create a boolean calculated field with this logic:


          // [Bad Data Filter]

          [Data Field] = "Bad Data" //Replace this line with logic that evaluates to true when the data is bad and false otherwise.


          Then place that calculated field on the filter shelf and set the filter condition to true.  Then any record where the [Bad Data Filter] calculated field evaluates to true will be filtered out.


          Feel free to reply with more specifics or an example of the bad data if you need any help with the specific logic.



          • 2. Re: Using a calculation to filter underlying data?
            Robert Morton

            Hi Douglas,


            This example is a great use case for a new feature in the upcoming Tableau v8.0 release. The new feature allows you to create the filter directly on the data source, and have it applied to all queries regardless of what other filters are in play on any given worksheet. The data source filter remains in place even as you export the data source or publish to Tableau Server to share with colleagues. You will be able to access this feature by right-clicking a data source and choosing "Edit Data Source Filters...".