2

I just want to set dynamic default values for datetime control in amazon quicksight. Just like startDate (last 7 date) and endDate (today date). In quicksight, is that possible? In aws document says that Calculated fields can't be used as dynamic defaults. So, how I can achieve this kind of simple thing in quicksight?

Appreciate for any advise.

funbrain9
  • 503
  • 6
  • 15

1 Answers1

3

This is a very tricky situation to handle.

Amazon QuickSight does not support using calculated fields as filters, so you cannot add the value you calculated as the default value for a parameter.

Normally you would have three options:

  • Add the desired value as a column (let's say new_date) in your dataset and update it with every refresh (so when you refresh the dataset that column would be calculated again), then use new_date as the default value for your parameter
  • Update the value manually (QuickSight GUI)
  • Update the value from CLI or Boto3

The first option would be working if Amazon QuickSight supported dynamic defaults for date values. But it does not. So you have only two options: either update it manually or update the value using CLI or Boto3.

The way I overcame it is, I created a Lambda function that updates the 2 date values in my dashboard.

First you need to use UpdateDashboard to update the dashboard parameters, then you need to use UpdateDashboardPublishedVersion to update the published version of the dashboard.

You can do it using a bash script and AWS CLI, or using Lambda functions and Boto3.

ahmetyv
  • 51
  • 6
  • Thank you for your informative answer @ahmetyv – funbrain9 Mar 16 '21 at 01:30
  • I just shared my experience. :) If you liked the answer, you could choose it as the best answer or upvote it if you feel like doing that. Good luck with QuickSight! @funbrain9 – ahmetyv Mar 17 '21 at 08:22