DATASET COPY

Is there an option to copy calculated fields when a DataSet is duplicated or saved under a different name? It appears that calculated fields are not automatically copied when the DataSet is duplicated.

Thanks,

Hamza Bohari

1 Like

Hi @HAMZA_BOHARI

Using QuickSight boto3 API, you can programmatically retrieve the calculated fields from the original dataset and apply them to the new dataset. This approach requires some scripting but can save time if you have many calculated fields.

Example : (Syntax may vary)

DescribeDataSet: This API call retrieves the metadata of a dataset, including the calculated fields. You can use this API call to fetch details about the calculated fields in your original dataset.

response = client.describe_data_set(
    AwsAccountId='string',
    DataSetId='string'
)

UpdateDataSet: This API call can be used to update an existing dataset with new calculated fields or modify existing ones. If you’ve already created a new dataset and want to add or update the calculated fields, you can use UpdateDataSet to apply these changes.

Please refer the below documentation this might be helpful for you.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/quicksight/client/describe_data_set.html

https://docs.aws.amazon.com/cli/latest/reference/quicksight/describe-data-set.html

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/quicksight/client/create_data_set.html

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/quicksight/client/update_data_set.html

Hope this helps!

1 Like

@HAMZA_BOHARI - If you add the calculated fields to the dataset side, these will copy over when you duplicate the dataset.

If you add the calculated fields to the analysis side, you will need to duplicate the analysis and then replace the underlying dataset with the duplicated dataset.

Hi @HAMZA_BOHARI,
It’s been awhile since we last heard from you; did you have any additional questions regarding your initial topic?

If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.

Thank you!

1 Like

Hi @HAMZA_BOHARI,
Since we haven’t heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!