Rename column/value via serverless configuration

I’m working on creating serverless configs for deployment of our Dashboards. We have some calculated fields configured as such:

                        ChartConfiguration:
                          FieldWells:
                            PivotTableAggregatedFieldWells:
                              Values:
                                - NumericalMeasureField:
                                    FieldId: "Total"
                                    Column: 
                                      ColumnName: "price"
                                      DataSetIdentifier: priceDetails
                                    AggregationFunction:
                                      SimpleNumericalAggregation: SUM
                                - NumericalMeasureField:
                                    FieldId: "Average"
                                    Column: 
                                      ColumnName: "price"
                                      DataSetIdentifier: priceDetails
                                    AggregationFunction:
                                      SimpleNumericalAggregation: AVERAGE
                                - NumericalMeasureField:
                                    FieldId: "Count"
                                    Column: 
                                      ColumnName: "price"
                                      DataSetIdentifier: priceDetails
                                    AggregationFunction:
                                      SimpleNumericalAggregation: COUNT

In our chart “price” shows up as the column header for all 3 columns (it is the name of the column in our DataSet). I see in the web console we can change the “value name” of the column headers in the Analysis.
How can I do this via serverless so that the column headers can be priceTotal , priceAverage , priceCount in the analysis or when this is used in a Dashboard.

Thanks.

Hello @billst , welcome to the Quicksight community!

Have you tested whether updating just column name in your template and deploying this to a test dashboard works?

For example change the column name in your template to Price (SUM) and then redeploying.

1 Like

The above example is in my Analysis so “price” is referring to a column in the dataset as I understand it so changing the ColumnName there will cause an error. Since I am aggregating 3 different ways on that field, I want to be able to differentiate between them in the table that I produce.
If you are saying I should configure this in my Template stanza, can you give an example of how this would be done?

Hello @billst, after digging through the documentation, it seems like you have 2 options to create the field with the name you want through the serverless configuration. If you want to do it through the createDashboard portion of the API, you won’t be able to do it through the ColumnIdentifier. Rather, you would want to use the CalculatedColumn or maybe even CalculatedField section. There you can give the same column the new name and aggregate it the same way you are in the dataset. Otherwise, you will need to change the name on createDataset, and utilize the new dataset in the dashboard.

I will mark this as the solution, but if you have any further questions, please let me know!