How to create a dynamic default value for a control

Hi, I’m looking to set a dynamic default value for a control.

I created a parameter and control for a string field, and I’d like to set a default value for that control. I’d like the default value to be the max value in the control list, meaning it would be dynamic. With every new dataset update, the max value in the string field will change, and thus in the control list. I’d like the control list’s new max value to be the new default value.

Here’s an example:
I have a string field that has a list of dates in the MM/DD/YYYY format. (I did not make the data type of this field “Date” and kept it a “String,” because QuickSight does not show the aforementioned date format I’d like). Upon making this a control, the control list looks like this:

With the next update of the dataset, a later date will show (e.g. 06/01/2023). I would like the new default value of the control to be 06/01/2023, considering it will be the new max value.

I understand that I can set a static default value but this would require a manual change every time the dataset is updated. I would like this to be dynamic, and the latest date (max value) would automatically show.

Hopefully the question’s clear. Thank you!

  1. First of all, you’ll have to change the field to a date field. If you leave it as a string, QuickSight can’t determine the max. If you have issues with the date format, we can address that separately. I see you’re using MM/dd/yyyy - that should not be a problem in QuickSight.

  2. Then create a copy of the dataset and use it to calculate the max value at the dataset level, e.g. by using SQL if your data source is a database. You also need to include a column that contains every reader’s UserName or GroupName.

  3. Create a parameter in your analysis and click on “Set a dynamic default”.

  4. Select the dataset from step #2, the column that contains the UserName or GroupName, and the column that contains your maximum value.

1 Like

@David_Wong Hello
I have the exactly same scenario but the above is not working for me.
I have created a parameter, Set the dynamic default to the field in the dataset which is having a single value (max of date).
In the control, I have selected it as dropdown and selected another field which displays all the dates I have in dataset.
The control shows the dropdown of all dates but the default selected is ALL in the dropdown. I want that to be max value which I have set in the parameter

Hi @Sam1,

When you set your dynamic default, did you select the column which contains the username or group name?

This is not working for my case as well. I even selected the username and group. Still when I show the control the dashboard we need to select again, by default it is showing select all. Please Help.

1 Like