I want to add a new dataset and keep my calculated fields for my old dataset. However, my calculated field are missing, and my visuals, parameters, and filters broke.
Short description
Calculated fields that you created in an analysis connect to the dataset that you created them on. If you remove a dataset from an analysis, then every analysis-level calculated field that you created on that dataset also gets removed.
If you deleted a visual, parameter default, filter, or other calculated field that references a removed calculated field, then you must restore the calculated fields.
To switch an analysis to a different dataset without losing your calculations, select a replacement dataset.
Resolution
Prerequisites:
- Before you make schema changes that might require a dataset replacement, back up the analysis with an asset bundle export.
- Before you change a dataset that's used by a production analysis, list the dependent dashboards and analyses. To list the dependent dashboards and analyses, see Tracking dashboards and analyses that use a dataset.
- Move calculations that you reuse across analyses out of the analysis and into the dataset. To add a calculated field to a dataset, see Adding calculated fields
Replace a dataset
If you replace a dataset, then you clear the history for the analysis. It's a best practice to replace a dataset after you edit a session. Make sure that you test the change in a copy of the analysis before you apply it to a production analysis.
To select a replacement dataset, see Replacing datasets.
If you use automatic mapping, then make sure that the columns in the new dataset use the same field names and the same data types as the columns in the old dataset.
Recover calculated fields
If you already removed the original dataset and your calculations are missing, then complete the following steps:
- Open the Amazon Quick console.
- Add the original dataset back to the analysis.
- Replace the dataset.
If you receive a "Mismatch in replacement dataset" error message, then see If your new dataset doesn't match.
If the original dataset is no longer available or if you deleted the dataset, then you must manually recreate the analysis-level calculated fields.