4 Replies Latest reply on Aug 17, 2011 4:28 AM by Philipp Saurer

    Parameters and Condition Filter

    Philipp Saurer

      We run in a problem when combining parameters with a condition filter. We want to show a group of transactions (grouped by a dimension called "Reason Code") when the balance is not 0 at a given end date. The user selects an end date using the parameter control (date is a string). The date filter is boolean setting all the transactions before the end date to true and after the end date to false.

       

      The reason codes with a balance of 0 are filtered out by using a condition filter. The condition filter only works correctly if the date filter is added to the context. However, if the date filter is added to the context, the user cannot change the end date using the parameter control.

       

      Any suggestions or workarounds?

       

      Philipp

       

      P.S.: The reason we use a parameter is that we work with multiple datasources.

        • 1. Re: Parameters and Condition Filter
          Richard Leeke

          I can't see why this wouldn't work, or why you would need to add to context.  Can you post a sample showing the problem?

           

          By the way, I'd never noticed before that adding a calculated field which references a parameter to the context "locks in" the current parameter value, but it makes sense.

          • 2. Re: Parameters and Condition Filter
            Joe Mako

            Sounds like you are trying to control the order of filtering with the context filters. There are a few options you have, and as Richard said, it would be best if we could see an example packaged workbook. One option is to take the filter that you want as a context filter and make it part of the calculated field that returns the values with an IF statement, that way your filter is effectively happening before other filters. Another option is to use table calculation filters because they happen after normal filters. It really depends on your exact situation because there may even be additional methods available as well.

            • 3. Re: Parameters and Condition Filter
              Philipp Saurer

              Joe - yes, I try to control the order of the filter by using context filter. The date filter needs to be applied before the condition-filter. The problem is, by adding my date filter to context, the user cannot change it using the parameter (locks in the current parameter as Richard puts it). To make a long story short: I am trying to control the order of the filters without using context.

               

              Richard, Thanks! I will post a workbook later.

               

              Philipp

              • 4. Re: Parameters and Condition Filter
                Philipp Saurer

                I found a solution to the problem by adding the date when the balance went to 0. I did this with a sql query in the datasource and not in Tableau.

                 

                Thanks for you inputs, Joe and Richard!