Creating a parameter to get duration between 2 date fields

How can I create a parameter to pick the number of days as value between 2 date fields

Hello @Sylvester and welcome to the QS community!!

From your question I understand that you want to create a parameter to get the number of days between two date fields (that I assume they are in your dataset).

Parameters in QuickSight are normally used to provide user (or programmatic interactivity), they are not designed to be set based on the underlying data so I would like to know which is the use case in particular here to better help you.

The only case I can think for such use case is to set a dynamic default value for the parameter, where in that case you will need to create a calculated field at dataset level getting the number of days between date1 and date2 and then use it for the default, e.g with dateDiff function.

dateDiff(date1, date2,'DD')

Hope it helps, please mark this solution as solved if that’s the case also to help other members of the community. Otherwise let us know a bit more about your use case to help you!

Happy dashboarding!

1 Like