Filtering data is an essential part of any exceptional QuickSight dashboard, especially as you increase the volume of your data and the complexity of the stories you want to show. In all great data stories the interaction of the audience plays a huge role in how compelling these stories are, and allowing your users to apply filter conditions themselves through filter controls is your most valuable resource for this. However, with great power comes great responsibility, and adding tons of filter controls for different variables can hinder the ability of your audience to follow the main plot of the story -much like a lot of us get lost in the vastness of today’s Marvel universe-.
URL parameters are a very handy tool when it comes to handling multiple filter controls in your QuickSight dashboards. Parameters are named variables that can transfer a value for use by an action or an object. By using parameters, you can create an easier way for a dashboard user to interact with dashboard features in a less technical way. Parameters in QuickSight can accomplish different tasks including filtering, automating calculated fields, creating actions, or adding external links to visuals. URL parameters allow users to add a query-like string at the end of the URL for a dashboard which automatically applies conditions to the filter controls mapped to your visuals. This happens upon loading the dashboard and without manually interacting with filter controls. Once implemented, users are able to use direct links that they can then bookmark with their specific set of parameters pre-defined. From substantial practical efficiency to providing less savvy users with a pre-filtered view, there is immeasurable value in implementing URL parameters.
In QuickSight, adding the string #p.parameter to a given dashboard URL to set that filter to the value 1234 results in the following:
AWS documentation on implementing URL parameters is unclear when it comes to explaining this tool. Although there are user guides on using parameters in URLs and parameter filtering, one has to combine knowledge in both of these features to actually apply URL parameters to filter visuals. This heuristic should provide everything needed to seamlessly add this feature to any dashboards.
Goal: To be clear and concise in the process to create URL parameters, we will be using a randomly generated dataset of clients for a fictional company. We will use a sample dashboard that includes three visuals: a client list table, clients by job title bar graph, and a pie chart showing clients by gender. The goal will be to add filter controls that can be edited using URL parameters. Specifically, URL parameters that filter User Name = Miguel Campos Ribau and Joined Date between 2022/01/01 and 2023/01/01 for the dashboard below with a URL that reads as:
For our purposes we want to use parameters to filter our visuals.
Navigate to Parameters in the left side bar and select Parameters.
Add a parameter with the plus sign at the top.
Name the parameter just like you would want to see for definitions in the URL.
Must be alphanumeric with no spaces. (ex. username to filter our UserName)
Select Multiple values to be able to keep a dropdown option if you want to add it to your dashboard for manual filtering.
Create and close.
For parameters using dates, you need to create two parameters, one for the start date and another for the end date.
Upon creation, select singlevalue instead of multiple values.
For datatype, select Datetime.
Pay attention to the Default date that you choose for these two parameters since they will automatically apply once you attach the parameter to the filter in your visuals. Unlike string parameters, you CANNOT leave it empty.
Create and close.
Step 2: Attach parameters to corresponding filters
Navigate to the Filter pane on the left of the screen. If there is already a filter for the field that you want to use, choose it to open its settings. Otherwise, create a filter for the field that you want to filter by parameter.
Select Custom filter for the Filter type and choose Equals for the Filter condition.
Select the Use parameters and a dropdown of ALL your created parameters will pop up.
Attach the corresponding parameter.
Apply and close.
The parameter is now active and attached to the corresponding filter, it can be used in a URL!
For parameters using dates, selecting Date & time range and selecting Condition equal to between will allow you to select the start and end date parameters you previously created.
Step 3: Add filters to controls or into your sheet (Optional)
In most cases, you will still want to add the filter to the top of the visual to avoid confusion on what your current selection is and to allow your user to manually be able to select desired values.
Navigate back to Parameters on the left side.
Select Add control to your desired parameter.
In the Add control menu, give it a name that matches the column that you are filtering. Select Link to a dataset field, select the Dataset where the column lives, and select the corresponding Field.
The parameter can now be used in the URL and will match the one present in the Controls section of the report so that it can also be used as any other manual filter!
Make sure that once you have entered the URL with the parameters you refresh the page; a simple enter will just modify the URL but changes won’t go through until you do that.
Parameters are added to the end of the URL by adding #, followed by p.parameter. to additional parameters & should come after the end of your last parameter definition.
Example: To filter the Joined Date between 2022/01/01 and 2023/01/01, URL should read as:
To return all values, set the parameter equal to All (p.username=All).
Congratulations on now being able to leverage the power of URL parameters! At this point, you should be able to start applying this strategy in all of your QuickSight dashboards. If you are interested in advanced solutions and implementations in Amazon QuickSight, please reach out.