1 Reply Latest reply on Jun 8, 2016 7:04 AM by Steve Burger

    How to filter by multiple dimensions in one filter (example if week and year were dimensions)

    jenn.ng

      My workbook has date and week in the dimensions. How do i set them as a filter variable such that when i select week, the measure values become aggregated by week?

       

      i tried creating parameters for week and year and date.

       

      then i created a calculated field which probably has some errors:

       

      Screen Shot 2016-06-07 at 2.49.35 AM.png

       

      This is an example of my parameter for week and year (data type = string and is a list):

      the date_dt parameter is a date for data type.

       

      Screen Shot 2016-06-07 at 2.50.18 AM.png

        • 1. Re: How to filter by multiple dimensions in one filter (example if week and year were dimensions)
          Steve Burger

          Good Morning Jenn,

           

          If I understand your question, you are on the right path.

           

          I've attached an example that I've previously created for another customer.

           

          In it, I've created a parameter that allows the end user to choose how they want the data to be aggregated (Week, Month, Year, etc.).

           

          Then, the parameter is evaluated in a calculated field as a "show/hide" filter.


          I put it all together in a dashboard using selective hide/reveal layout containers based on the "show/hide" filter.

           

          Detailed steps below.

           

          Please mark this response as "helpful" and/or "answers correctly" if I addressed your question appropriately so that others can find it quickly.

           

          Best Regards,

           

          Steve Burger

          Tableau Online Deployment Advisor

           

          1. Construct a view for each condition. In this example I have a line chart for sales by a.) Year, b.) Month and c.) Day. (Tabs are colored Blue.) In your case, it’ll be at the level of each dimension in the hierarchy.

          2. Create a Parameter describing each of the selections you want to offer the user. Data Type: String, Allowable Values: List. In my case it’s the Year, Month, or Day selection. In your case, it would probably be the respective levels of granularity.



          3. Create the calculated field that will serve as your filter condition for hiding / revealing the selected views on the dashboard. A case statement works best for this.  It will create a flagged condition based on the users Parameter selection.



           
           

           

          4. Create a New Dashboard. Drag in a Horizontal layout container to the blank dashboard. Then drag a Vertical layout container into that. Then drag your three views one on top of another.




           
           

           

          5. On each of the views in the dash, right click at the title of each view, Year, Month and Day, and select “Hide Title” for each, hiding the titles for each of the views in the dashboard. (If you don’t do this step, the views title will remain and not be “hidden”.)




           
           

          6. Go back to each of the individual views and place the recently created calculated field on the Filters shelf of each of the three views. DO NOT worry about selecting/clicking a box or filter condition at this time. Simply put it in the Filter shelf and click “OK”.





          7. Go to the first view, right click on the Parameter name on the Parameter list and select “Show Parameter Control”. Choose the Parameter option appropriate for that view. For example, I’m on the Year view and I will select Year from my Parameter list on this view. NOW, right click on the “Show Data Format Filter” pill on the Filter shelf, choose “Edit Filter” and place a check box in what should be the only filter options “Show Year”. (The View should re-appear). Repeat each of these steps in each of the other views. Make sure you change the Parameter Control (Date Format Selector) to the appropriate value for that view, before editing the Filter!!!!

           

           

           

           

           

          8. Return to the Dashboard. One of the three views should be revealed and the other two should be hidden. Right click in the upper right of the view, select the Parameter option from the list, and then from the sub-list the parameter used to select. (Date Format Selector for our example).

           

           

           

          9. Test away! You should be in business.

          1 of 1 people found this helpful