In this chapter, we will learn how to develop interactive dashboards with Amazon QuickSight. You will learn how to add custom controls to your dashboards and add interactivity to your BI application using parameters. We will also look at advanced filtering options with point and click actions, as well as URL actions.
In this chapter, we will cover the following topics:
For this chapter, you will need the following:
Users can interact with dashboards by clicking on specific areas of the application or hovering over a visual to get additional information on specific data points. As a BI developer, you might come across scenarios where you will need to add additional interactivity to your dashboards, allowing your users to filter datasets or implement specific actions. In this section, we will learn how to leverage those specific QuickSight features to add interactivity to our dashboards. We will provide hands-on examples while using the New York dataset and dashboard we developed earlier in Chapter 4, Developing Visuals and Dashboards. But first, we will need to understand how to use QuickSight filters.
QuickSight authors can filter datasets. For example, you can use filtering when you need to refine a dataset before you visualize it. You can control the scope of the QuickSight filters so that they can be applied to the visuals you want. Filtering, when applied to a QuickSight analysis, is transparent from the reader's perspective. You can apply additional settings when sharing a dashboard with your readers if you need to allow your readers to filter data. Let's look at an example to understand how to add and apply filters. For our example, let's assume that we have detected null values and that we want to remove them from certain visuals:
By default, filters don't appear on the reader user interface. Some BI applications might need to give users the ability to filter data.
Note
When filtering a dataset, QuickSight will query the dataset and then apply filtering. If your dataset has been configured as a direct query, QuickSight will connect to the data source to fetch the latest data before filtering. If your dataset is configured as a SPICE dataset, then QuickSight will fetch the data directly from SPICE, without the need to query or import data from the original data source.
To allow our reader users to filter data, we need to check the Enable ad hoc filtering option on the dashboard publishing screen. This option can be found under Advanced publish options, as shown here:
Now that we have learned how to add a filter, let's introduce the concept of QuickSight parameters.
Parameters in QuickSight are variables that a user can set, commonly using on-screen controls. A parameter can be used in various ways. For example, we can filter the analysis data dynamically based on a parameter. To understand this concept, we will use our example New York taxi analysis. Let's assume that our business users need to understand patterns and changes in customer behaviors based on what payment type the customers are using. To implement this use case, we will create a parameter that will store the user selection for the Payment Type field.
Creating a parameter is straightforward, as shown here:
At this stage, our parameter has been added to the analysis, but we are not using it yet. Next, we will link this parameter to the filter we created earlier.
While we are still on the analysis and logged in as the author user, to link parameters to filters, we will need to do the following:
Note
The scope of the filter can be edited at any time once the parameter has been created. The scope update will have an immediate effect, without the need to update the parameters or your controls.
Now that our filter and parameter are connected, the filter will inherit the default values of our parameter. In our example, we have used a multi-value parameter. We can confirm that the pivot table only displays the records that contain the default values of the parameter. Now that we have linked the parameter with the visual, we will learn how to add on-screen controls and allow readers to change the parameter value.
QuickSight allows you to add on-screen controls so that your reader users can set the value of a parameter dynamically. In our example, setting the paymenttype parameter value will result in changes in the value of the Payment Type filter, which has been applied to the pivot table visual. To add an onscreen control, follow these steps:
Now that we've added the on-screen control, we have all the required components that allow us to publish interactive dashboards. Let's look at the sequence of events that enable interactivity on our dashboards:
The following diagram depicts the flow described here:
Now that we have configured all the required components, let's test the on-screen controls:
Now that we have configured the analysis and arranged the onscreen controls, we can publish the analysis as a dashboard and share it with our reader users. With that, we have created our first truly interactive QuickSight dashboard. Next, we will learn how to use actions to add more interactive controls to our dashboards.
QuickSight Actions allow you to add interactivity to your dashboards. They can be any of the following:
Next, we will look closer at each of these action types. To understand each type, we will configure them using our New York taxi sample analysis.
URL actions allow us to instantly filter data when the user clicks on a specific area of a dashboard. Filter actions make it easier for your readers to focus on specific data points of the analysis.
When configuring filter actions, you will need to choose a visual in your analysis and then provide the following information:
To understand filter actions, we will use an example from our New York Taxi analysis. Let's assume that we want our users to instantly focus on a specific borough and update the KPI and Sankey visual to reflect the selected borough only. To select a borough, we will use the bar chart diagram that displays the average tip per borough, which we configured in Chapter 4, Developing Visuals and Dashboards:
We'll update the following parameters:
The filter action has now been applied. To quickly test the newly created action, just click on any Pickup Borough data point on the bar chart and notice how the target visuals update. For example, with the Queens borough selected, we can see an example of how the Sankey diagram looks, as follows:
Feel free to try adding add more filter actions to other visuals in your analysis. Next, we will learn how to configure navigation actions.
As you are adding visuals to analysis, it can reach a point when there might be too many visuals for a single page. In these scenarios, you can organize visuals into sheets. For each sheet, you can provide a user-friendly name to help your BI users navigate the dashboard. For each sheet, you can provide the following details:
Both can help give your users context. Title and description can be particularly useful in scenarios where there are many sheets. Navigation actions can help you define actions that will allow your users to quickly navigate to different sheets within the same analysis.
When configuring navigation actions, you will need to choose a visual in your analysis and then provide the following information:
Next, we will look at another type of action: URL actions.
URL actions allow us to redirect our user to another website or another dashboard when the user clicks on a specific area of a dashboard. URL actions can help your BI users easily retrieve additional context for the dashboard.
When configuring URL actions, you will need to choose a visual in your analysis and then provide the following information:
Note
You can add references to the parameters of field values in the URL field. This will allow you to redirect your users to different URLs, based on the user selection. The syntax to refer to a parameter is <<$parameter-name>>, while the syntax to refer to a field is {{field-name}}.
To understand how to set up URL actions, we will use our New York Taxi analysis. Let's assume that we need to add a link to an external website with additional information on each of the New York boroughs. For this example, we will use the bar chart visual we configured in Chapter 4, Developing Visuals and Dashboards. We will use Wikipedia as our external website:
These values are as follows:
The URL action has now been applied to our visual. To test URL actions, you need to click on the data points of the visual where you applied the action. In our example, every data point will redirect to a different URL, since we are using the Pickup Borough field as part of our URL. When you test something like this in the real world, you will need to ensure that each URL is redirecting the user correctly. The following screenshot is what we'll see upon right-clicking on the Manhattan bar in our bar chart. Notice that a Wikipedia look up menu option appears, which will redirect us to the Manhattan Wikipedia page (https://en.wikipedia.org/wiki/Manhattan) when we click on it:
Thus, we have figured out how to work with various types of actions as well.
Congratulations on completing this chapter! In this chapter, we learned how to add interactivity to our dashboards. We learned how to add QuickSight parameters and on-screen controls to filter the data of our analysis following user input. We also learned how to configure the three types of actions: the filter action, the navigation action, and the URL action. Using these features, you will be able to create BI applications, with interactive controls enhancing the user experience of your BI applications. With the actions we learned about in this chapter, your users will be able to perform single-click filtering, navigate easily between multiple sheets, and open external websites that provide additional context.
In the next chapter, we will learn how to use insights and add machine learning to our analyses.
52.14.113.166