6 Replies Latest reply on Oct 14, 2014 8:35 AM by Matt Lutton

    Sample Size Flag Issue

    Michael Schuster

      I am trying to create a flag when something has a low base size.  It works when there is data being shown (when something has a base size of 1,000 and below, it gives a warning and when it doesn't it shows nothing), but when a user is changing filters and is in between data being loaded, the window shows "All" when I'm trying to show nothing.  Here is the query: 


      IF WINDOW_SUM(SUM([Customer Detail]), First(), Last()) <= 1000 THEN "WARNING! LOW BASE SIZE"

      ELSEIF WINDOW_SUM(SUM([Customer Detail]), First(), Last()) > 1000 THEN ""

      ELSEIF ISNULL(WINDOW_SUM(SUM([Customer Detail]), First(), Last())) THEN ""



      Does anyone know a solution to this problem?

        • 1. Re: Sample Size Flag Issue
          Matt Lutton

          I believe this is due to the order of operations in Tableau.  Table Calculations are performed later in the pipeline than quick filters, so without seeing your workbook, I am guessing this is a result of the order in which Tableau is handling these operations.  You could check the log files to see what queries are being sent in order to verify this, I believe.


          I do not know of a solution off the top of my head.   You might be able to switch your quick filters to be Table Calculation filters, so they would also apply later in the pipeline.


          This type of problem can be incredibly frustrating, because Tableau does not give us any visual indication of what is occurring.  It is only through reading through Forum threads and blog posts (which are still not complete, in terms of all the operations)that folks begin to understand these concepts--here is one such post I refer to often:

          Re: Question on how to create a product velocity calculation


          In terms of changing quick filters into Table Calc filters, we can sometimes accomplish this with a calculated field of:


          LOOKUP(MIN([Category]),0)   -- this would take a [Category] field and turn it into a Table Calc filter.  You can use MIN, MAX, ATTR(), or any other aggregation.


          If you can post an example, I'll take a look.  This works in many cases, but not all, and depends on a number of factors, including what else you are expecting to do in the sheet/view, in terms of filtering, actions, etc.

          1 of 1 people found this helpful
          • 2. Re: Sample Size Flag Issue
            Michael Schuster

            Thanks Matthew.  Here is an example of what I'm seeing.  When a Profit (bin) is selected, the Title shows up correctly.  However when nothing is selected and there is no data shown, "All" is appearing.  Thanks again

            • 3. Re: Sample Size Flag Issue
              Matt Lutton

              I see what you mean but don't have time to look at it now.  I'm not sure of the explanation in this case, but you may want to look and see if anything in this post applies:


              Identifying (and Using) Quick Filter Selection Status | Drawing with Numbers


              Since the Profit(bin) cannot be used in a calc, I'm not sure if that is part of the issue.  I would expect ELSE " " to return a blank title, but the "ALL" seems to be generated by Tableau and we don't get much of an indication as to why that is being returned (it certainly isn't part of your calculation).


              I'll take a look again later if I can.

              • 4. Re: Sample Size Flag Issue
                Michael Schuster

                Is there a way to dynamically change the color of a title when certain things are being shown?  I was thinking maybe I can just make the font white when the "All" title is being shown.  I'm not sure if this is possible but maybe someone else has seen or done this before.

                • 5. Re: Sample Size Flag Issue
                  Joe Oppelt

                  I know tyou can "change" the color with conditional formatting.


                  See this link:


                  Conditionally Formatting Tooltips | Tableau Software


                  But if you can detect the value of "ALL", you could just handle it in the TITLE calc field you already have.


                  Have you considered talking "All" out of the filter?  (Edit filter with the pullown on the screen.  Select "Customize".  Uncheck "Show ALL value".)  Maybe you have to have it in there.  But if you don't, it looks like that would be a workaround to what you are seeing.

                  • 6. Re: Sample Size Flag Issue
                    Matt Lutton

                    I'm wondering if Jonathan Drummey can suggest a solution.  Using his "Identifying (and Using) Quick Filter Status" blog post, I think it could be accomplished -- the one issue I kept running into was the Profit (bin)... there's no way to refer to that in a calculated field, as far as I know.  If we used a calculated field to create our Bins, it might be possible to apply his solution using the duplicated data source.  But I'm not sure if its even possible, and I'm also not quite sure how I'd re-create these bins using a calculated field (there's quite a few bins there...)


                    Any thoughts here Jonathan?