1 2 Previous Next 16 Replies Latest reply on Feb 28, 2013 9:02 AM by Patricia Santillan

    Global Measure Quick Filter?

    Chris Tsui

      Hi All,


      Am fairly new to Tableau and am trying to play around with two sheets.  One is primarily a data sheet and one a a trending sort of line graph.

      They both use the same quick filters when I put them both into the Dashboard, I made 2 of the 3 quick filters Global which does exactly what I want.


      My issue is that I'm trying to make my last quick filter which is a collection of filters (Using Measure names?) global, but when I click on the "menu" and go to where the "Make global" was on the other two, it doesn't show up.  I recognize this is a different sort of quick filter (other two were dimensions, and this one is measures and also a list of different measures) but was curious if there was a a way to do this?


      I did some "light seacrhing" in this forumn and a myriad of different google searches to no avail


      Any help would be appreciated!




        • 1. Re: Global Measure Quick Filter?
          Mark Holtz

          Hi Chris,


          The Measure Values is a special field created in Tableau. As you see, it doesn't behave like normal dimensions.


          I'm not exactly clear on what you're trying to do. Can you provide more detail around how exactly you're trying to filter your measures?  Are you just wanting to allow the user to swap out the measure being displayed one at a time--i.e., would your intent be to use a drop-down single select filter?


          If so, you can accomplish that using a parameter in conjunction with a calculated field. Otherwise, you might have to wait for a more skilled Tableau-er to come along...

          1 of 1 people found this helpful
          • 2. Re: Global Measure Quick Filter?
            Chris Tsui

            Hi Mark,


            Thanks for the quick response!


            Sorry about the lack of details in my original resposne.

            My current data source is a cube (not sure if that factors)


            I created a mock up where I have my supplier in the rows, 

            Calendar quarters in the columns

            Supplier business category as a filter (dimension)

            there are several measures that we want to be able to select through such as timeliness, costs etc.


            For one particular worksheet, I setup the category, supplier and measure names as my quick filters.  Works perfectly


            I then setup a second worksheet that uses

            Measure values as the rows

            Quartesr as the column

            Supplier as the colour

            With Supplier, Category and measure names as the quick filters again


            what I then did was create a dashboard with both these worksheets

            I made the category and supplier filters global (thus changing the filter reflects on both dashboard panels)

            I was simply hoping to make the Measure name quick filter global as well, but it doesn't appear I can.


            I was hoping that there was a way to do so given that the filters in both sheets are alike.


            I hope that answers your initial question.  Again, pleae bear with me as I'm totally new to this




            • 3. Re: Global Measure Quick Filter?
              Mark Holtz

              Can you post a screenshot or share your workbook?

              I'm still not understanding how users would filter the measures. 


              Are they always viewing more than 1 measure at a time?

              • 4. Re: Global Measure Quick Filter?
                Chris Tsui

                Hi Mark,


                Thanks again for the reply!


                Due to some of the confidential nature of the info I've blanked out alot of the data, so hopefully what I post is still helpful


                In the screenshot I have a dashboard for two worksheets

                The Mock up uses the "NAME", "Measure Names (Table)", "Name" quick filters on the right.

                The Trends uses the "NAME", "Measure Names (Chart)", "Name" quick filters


                I was able to make both the "NAME" & "Name" filters global so the changes I make to them reflect on both worksheets


                I was hoping to "combine/link" the two Measure Name filters to do the same thing.  Seemed simple, but for the life of me I can't figure it out!


                Currently the Measure Names filter is setup to only show one measure at a time (for QA and performance)  however I would change this to a multiple selection list in the future when I publish.


                I hope this makes sense and welcome anymore feedback and advice!

                • 5. Re: Global Measure Quick Filter?
                  Mark Holtz

                  Well, showing one measure at a time sliced by the Quarter dimension on each view (the way your screenshot appears to have it) is definitely possible at a global level. You can do with a Parameter and a new calculated field as I alluded to before:


                  Say you have [Sales] and [Profit] measures and you want to give the user the ability to quickly toggle which one appears on the graph (without having to have Tableau Desktop).

                  1) Create a Parameter called [Choose Measure] and make it a string list with "Sales" and "Profit" as options.

                  2) Create a calculate field called [Selected Measure] with this logic:

                  IF [Choose Measure]='Sales'

                  THEN [Sales]

                  ELSEIF [Choose Measure]='Profit'

                  THEN [Profit]

                  ELSE 0


                  3) Add the [Selected Measure] to your views (instead of [Measure Values].

                  4) Expose the [Choose Measure] parameter and your users can now control what data is displayed in your views.

                  **note that you can only choose one number format. Tableau doesn't have native conditional formatting functionality. This is sometimes a headache when you have $ and non-$ (e.g., count) figures.  You can get around it, but it's not pretty (involves making strings with '$' and concatenating...)


                  Personally, I find viewing more than 1 measure at a time, especially in a cross-tab type table is laborious.

                  Either you have 2+ rows or 2+ columns "next to" each other and you would want to compare every other (or every nth) row/column to be comparing "like" data i.e., the same measure.


                  Other than that, I am not actually aware of any way to globally filter Measure Names within a workbook, like with dashboard actions or some other neat trick.  Maybe someone else has an idea.


                  Hope this helps!

                  1 of 1 people found this helpful
                  • 6. Re: Global Measure Quick Filter?
                    Chris Tsui

                    Thanks Mark!


                    I implemented this code and it looks like it works quite well!

                    I recognize your point about having more than one measure at a time and will suggest this to my users in hopes that its accepted!


                    Had initially thought it was a simple setting somewhere that I had missed but it looks like this way works quite well, as well!


                    Once again Thank you!

                    • 7. Re: Global Measure Quick Filter?

                      Hello Mark,

                      I had this same question, but came up with the following solution. Do you see anything in my solution that raises a flag or would be incorrect, inaccurate, or misleading?


                      1) Create a Parameter called [Choose Measure] and make it a string list with "Sales" and "Profit" as options.

                      2) Create a calculate field called [Selected Measure] with this logic:


                      CASE [Choose Measure]

                      WHEN 'Sales' THEN [Sales]

                      WHEN 'Profit' THEN [Profit]


                      • 8. Re: Global Measure Quick Filter?
                        Chris Tsui

                        Hi Colby,


                        I actually do the same thing on mine now and have added aggregations to it so that I can manipulate the aggregation each metric does when chosen:


                        A la,


                        Case [Choose Measure]

                        When 'Sales' Then Count ([Sales])

                        When 'Profit' Then Sum ([Profit])



                        Hope that helps!


                        • 9. Re: Global Measure Quick Filter?
                          Mark Holtz

                          Hi Colby,

                          Nothing wrong with using the CASE WHEN structure in place of my preferred IF THEN construct. I was an analyst before I was any sort of developer, so I just prefer to "read" the logic aloud as I create it. I find it's easier for me to keep track of when it flows verbally.


                          In case you wanted to know, Tableau also supports the iif (logical test,value if true, value if false) construct. I am not sure why you'd use one over the other--in this case of just a 2-branch logic test, I think it's just user preference. If you get into a lot of branches, CASE becomes a bit simpler to read/debug.


                          Regarding what Chris mentioned, you can absolutely throw your aggregations with the measures as well. To take it a step further, if you wanted to be able to permit the user to get to "count of sales" OR "sum of sales" you could do so.  You would just expand your parameter options:
                          Sales (total), Sales (count), Average Sales, and Profit

                          Then, the IF/CASE becomes:

                          CASE [Choose Measure]
                          WHEN 'Sales (total)' THEN SUM([Sales])
                          WHEN 'Sales (count)' THEN COUNT([Sales])
                          WHEN 'Average Sales' THEN AVG([Sales])
                          WHEN 'Profit' THEN 'SUM([Profit])


                          The difference will be that your Measure pill (green) on your view will always display AGG() and you cannot control it outside the calculation. This has repercussions if you're going to use Table Calculations (running sum, etc) in that you are pre-determining the "inner" calculation, so don't let that catch you off guard.

                          1 of 1 people found this helpful
                          • 10. Re: Global Measure Quick Filter?
                            Shawn Wallwork

                            Mark Holtz wrote:


                            In case you wanted to know, Tableau also supports the iif (logical test,value if true, value if false) construct. I am not sure why you'd use one over the other


                            Mark, others have said that the IIF construct is slower, and encouraged everyone to use IF THEN instead. I don't have any first hand experience with this though.


                            See what Jonathan wrote below.



                            • 11. Re: Global Measure Quick Filter?
                              Jonathan Drummey

                              I asked Tableau tech support awhile back, here's what they said:



                              IIF or IF statements will be faster than CASE statements.  On large data sources, IIF statements are fastest, primarily since it does not check more than two items.  For simple IF statements there may not be much of a performance difference between using an IIF or IF statement.



                              Also, according to one of the TCC12 videos, apparently there is a performance issue in 7.0 around IF statements being slower, and the statement was also made on that video that the issue has been fixed for v8.



                              1 of 1 people found this helpful
                              • 12. Re: Global Measure Quick Filter?
                                Mark Holtz

                                Thanks for sharing Jonathan and Shawn. Always good to know how to squeeze every last drop of performance out of our tool when the CEO is already red in the face and the steam is about to come out of his ears...

                                • 13. Re: Global Measure Quick Filter?

                                  Thanks for all the great responses. I really like the versatility, but it's always good to understand the pros and cons of each method. Given the size of data I'll potentially be working with, the IIF method may be the way to go in some of my future visualizations.

                                  Chris, do you know if it's possible to represent two different number formats? Say instead of Sales and Profit, it's SUM(Sales) and COUNT(Sales)... can one be presented as currency and the other presented normal? I can't seem to format them differently.

                                  • 14. Re: Global Measure Quick Filter?
                                    Patricia Santillan

                                    I have a similar Tableau View that uses a Parameter to swap between 8 different benchmarks that the user can choose from and I did use the case statment and it works fine.  I'd like to take this a step further to the reference lines. 


                                    What if I wanted the Goal for each of those benchmarks to be a reference line on the graph that only appeared when that benchmark is selected. For instance the goal for Cost per passenger is $7, the goal for recovery ratio is 20% and the goal for Passengers per revenue mile is .60.  How do I get the reference line to appear in the right spot based on the user's selection. 

                                    1 2 Previous Next