4 Replies Latest reply on Sep 11, 2015 7:02 AM by geeta.parekh

    Selectively show metrics based on parameter and another dimension

    geeta.parekh

      Here is the tableau workbook. There are 3 tabs. Overall, view1 and view2. In the overall view, the list is by customers from 2 states: Caliornia and Alabama.

      The overall has 3 basic metrics that is applicable to anyone from these 2 states.

      But view 1 has a set of 4 metrics that is only applicable to people from California

      and view 2 has a set of 6 metrics that is only applicable to people from Alabama.

      Now the overall view will be on the dashboard. If I click on a customer name, then tableau should automatically calculate which state the customer is from ( California or Alabama) and depending on that show View 1 or View 2 in the dashboard.

      Does anyone know how to do this?

        • 1. Re: Selectively show metrics based on parameter and another dimension
          Wesley Magee

          Geeta,

          First, you should save the workbook as a twbx file as, depending on which version of Tableau people are running, some might not have that data set.

           

          I think your best solution would be to float view 1 and view 2 on top of each other and then add a filter action based on the overall. When you select a customer only related to one state, the information for the other state should disappear. Let me know if this won't work for you and we can think of another solution.

          -Wesley

          • 2. Re: Selectively show metrics based on parameter and another dimension
            geeta.parekh

            Thanks Wesley for your reply. I am attaching the twbx version.

            I have worked with filter actions, but I am not understanding how to do the filter action here for this specific purpose.

             

            To add more depth to my problem:

            The overall can have many number of customers from any states.

            For simplicity right now I have customers from 5 states.  But the 2 views are fixed. a customer can only have one view (either view 1(containing States Arizona, Alaska, Alabama) or view 2(containing CA and Colorado)).

            But in reality this will grow and so will the view sheets.

            I want to see only a specific view for a certain customer, not both of them.

            So how do I tell tableau, like if the Report USER selects a customer, then I want to use a case statement behind the scenes

            and say if this customer is from California, then select sheet view2 or else select view1.

            I want tableau to automatically know which state the customer is from and then show that sheet, based on a case statement.

             

            In future there will be more states and there might be max 4 or 5 views (or seperate sheets).

            Each view will have specific set of metrics, but different from other views.

            But the views will have metrics only related to a State. For example:

            View 1 contains metrics for (AL,AK,AR),

            View 2 contains metrics for (CA,CO, WI,WA)

            View 3 contains metrics for (HI,IL,ID) and so on.

            The problem is I want to show only those metrics for a customer, where the metric is only applicable for his state.

            I want the solution to be scalable and not need to have more than 10 sheets for this purpose.

             

            Also the overall does not have to be sheet. I can make it a parameter or a filter and then select the view accordingly.

            Hope this makes it clear.

            • 3. Re: Selectively show metrics based on parameter and another dimension
              jon rios

              hi geeta, it looks like you might have to do a new calculated Field and use the LOOKUP() function. Show all the Measure names then use the Lookup function to return the ones you need.  If you have multiple criteria (multiple states that share same columns) then use a CASE statement

               

              You can nest IF THEN ELSE within the LOOKUP function to determine which fields to show based on the state selected...

               

              then drag this new calculated field to the filter shelf.

               

              • 4. Re: Selectively show metrics based on parameter and another dimension
                geeta.parekh

                Is it possible for you to show how to do the lookup in the book attached?