Adding User-Interactivity to AWS QuickSight Dashboards
This article is a part2 of the AWS QuickSight series. In part1 we have discussed various aspects of QuickSight but something was missing, isn’t it?
Yes, User Interactivity!
Let’s say, I as a user want to view population data only between 2015–2017?
or I would like to view accidents data for the first half of the year (January to June) or the second half?
Or you want to specifically choose months?
With the current dashboards, doing that is not possible, that is when filter comes into action.
A filter allows you to remove unwanted data in a field provided with a condition. It will only allow that data which satisfies the condition or vice versa.
You could add one or more filters to a visual, or create a filter and apply it to all visuals or maybe specifically choose certain visuals; it all depends on the use-case. I recommend exercising all the above options to better understand them.
Filters are applicable at a dataset level. So, any visual using that dataset will be affected.
Let’s create a filter for the Population by Year visual to the year field.
This will open the Applied filters window for selected visual. It shows the list of all filters applied for that visual.
Let’s add a filter and choose the Year field.
You would see different settings under it, like Filter type, Use parameters, Exclude nulls, etc. For each filter type, the settings would change accordingly, I recommend you to exercise all options and choose your best fit.
In the above example, the year is a field of type date. So, the range is the best fit for it. We shall set a range for the date, in the above case (2012 — 2015) using Start date and End date fields in the Edit filter settings window.
Once filter properties are applied, only the data that is in the given range is visualized. This can be seen in the above image.
Filters can be of different forms based on the datatype of the field chosen. For instance, in the case of date datatype, it is a range, it might be different for a string or number.
Scope of a filter
We could choose to apply a filter to all visuals or specifically choose certain visuals.
A parameter with a Control
Usually, a dashboard user would want to change the date range. We could use a parameter to make that happen.
A parameter is more like a variable that stores some value & is passed to a filter/function.
To allow a user to modify/scale this parameter we use a control.
Parameter and Control go hand in hand. They together make user interactivity in Quicksight dashboards a reality.
Let us look into what parameter actually is.
This will create a parameter. Parameters can have a static default value which you could manually enter or a dynamic value. The dynamic default value is taken from the dataset. We have to specify the column name for it to choose.
I followed the above process and created an EndDate parameter as well. This way time interval for visual could be set using StartDate & EndDate.
We have successfully created parameters let’s add controls to these parameters.
I recommend keeping both the names of control and parameter the same as it would be less confusing. We would be provided with multiple style options for each control based on the datatype of the parameter.
Using parameters in a filter
Let’s try changing the time interval using EndDate control and see how it impacts the visual.
We have successfully added user-interactivity to our dashboard. By following the same process, I shall create other controls and parameters which can be used to filter the values for other visuals.
For the following visual, I want to select District names using a control.
I have created a filter for Accidents per District visual to the District Name field. As discussed earlier Filter type defines the conditions of a filter. I would recommend you to choose the Custom filter for string, number, other datatypes as it gives you the option to not only use parameters but also lets you set checkbox style for selecting multiple values in control.
Let’s create a parameter with control and use the parameter in the filter we created earlier.
Once the parameter is created let’s add control to it. As discussed earlier, for multiple values — the style of the control is a multi-select drop down, which is just a drop down of checkboxes to select multiple values or none.
The values displayed in this drop-down list can be specified or linked directly from a dataset field as shown in the below image.
Once this control is added, by default all the values in the control drop-down are selected.
Add this parameter and control to our filter.
Apply the settings.
We could see no data as all values are un-selected in the DistrictName control.
Now, let us select the District names and see how it impacts the visual.
Thanks for the read, if any queries, please leave them in the comment section.
This story is authored by Koushik. He is a software engineer and a keen data science and machine learning enthusiast.