7 Replies Latest reply on Oct 16, 2012 1:26 PM by Mark Holtz

    metric grouping parameter

    Anna Chan

      Is there a way to have a calculated field or parameter that groups metrics together, aka clicks, impressions, views into a category called Metrics 1, CTR, CPA, CPC into Metrics 2. Then have two drop downs with metrics 1, metrics being in one, and the other metrics being in the other drop down. The other drop down populating only metrics relevant to metric 1 or 2?

        • 1. Re: metric grouping parameter
          Mark Holtz

          Hi Anna,


          It sounds like you should be able to do what you're describing, but I am having a little trouble following. Can you post a packaged workbook?

          • 2. Re: metric grouping parameter
            Anna Chan

            In this help file, Fields is the parameter, and i want it so if i pick Field 1, my values available in the second drop down is Mentions, If i pick field 2, the my values avaialble in the 2nd drop down would be visits.

            • 3. Re: metric grouping parameter
              Mark Holtz

              To ensure I understand what you're asking for I'll attempt to re-state what I think you're asking using your example fields:


              You have 2 parameters-- Fields and Choose Metric.


              Metric choices are Visits & Mentions (& Clicks)

              Fields choices are supposed to be Field 1, Field 2, Field 3 (CTR, CPA and CPC)


              So a user could select Visits with Field 1 and you'd want a specific stat to show?

              Or they could combine Mentions with CTR (Field 1) and you'd show a different stat?


              If each set of measure Fields is unique for each Metric Choice, could you just make a concatenated version of the parameter?


              Visits - Field 1

              Visits - Field 2

              Mentions - Field 1

              Mentions - Field 2

              Clicks - CTR

              Clicks - CPA

              Clicks - CPC

              • 4. Re: metric grouping parameter
                Anna Chan

                I'm not sure what you mean by concatenated version of each parameter... id want to select field one and have it show a list of stats relevant to field one (aka field one, mentions, another metrics, another metrics), if i were to select field two ( a list of relevant stats would be visits, another metric, another metric)...

                • 5. Re: metric grouping parameter
                  Mark Holtz

                  I understand what you are asking for is a way to quick filter the special Measure Names field that Tableau provides. However, to my knowledge, that is not currently possible.  There are some ideas on the idea section of the Tableau community website around that topic. Absent that capability, what I was suggesting was a way to possibly get what you want using a parameter and calculated field combination.


                  Maybe this illustration will help more (I don't know what types of metrics there would be under "Mentions", so I just made generic metric names of ABC, DEF and GHI). Each "family" of metric types has a couple member metrics.

                  FamilyMetric Name


                  So you'd make your parameter list literally look like [Family] + '-' + [Metric Name].
                  Clicks - CTR...
                  Clicks - CPC...
                  Mentions - GHI


                  Then you could make an if statement case statement in a calculated field that will give you the measure selected:

                  IF [Parameter] = 'Clicks - CTR' THEN [CTR field]...
                  ELSEIF [Parameter] = 'Clicks - CPC' THEN [CPC field]...
                  ELSEIF [Parameter] = 'Mentions - GHI' THEN [GHI field]...


                  This way, the user can control the metric with 2 levels of "selection" all at once.

                  • 6. Re: metric grouping parameter
                    Anna Chan

                    wouldnt the primary drop down then show Clicks -CTR, Clicks - CPC, Mentions - GHI etc.. Id only want the primary drop down to show Clicks or Mentions, then the secondary drop down to show the list of available metrics from each category

                    • 7. Re: metric grouping parameter
                      Mark Holtz

                      Correct. You cannot set the Measure Names filter list, what you are referring to as "available metrics", to be dependent on any other field selection and set the filter as "relevant values" as you can with all other quick filters. The Measure Names field is a special field that Tableau creates based on deciding which fields in the data are Measures.


                      You would have to re-structure your underlying data to be able to use 2 dimension fields as the filters, which I assume would be a gruesome task...

                      Additionally, that would be nasty if your measures are different data types, or even of different precision/scale


                      for example:

                      Category     MeasureName     MeasureValue

                      Clicks          CTR                    90%

                      Clicks          CPA                    15

                      Clicks          CPC                    4.2


                      It'd be very difficult to format the [MeasureValue] field to show data reasonably in all cases.

                      You also cannot set number formats to be conditional based on filters.