Calculated Fields - Metrics

I’m having trouble calculating a specific metric. Can someone walk me through the steps to solve this problem?

1 Like

Certainly, @vignesh.sivakumar. You can use the Calculated Metric feature. Here are the steps to create one:

  1. To access the SME screen, navigate to Data Management and click on the settings icon for the dataset you want to work with. Then, select Configure SME.
  2. Once you are on the SME screen, you will see a settings icon on the top right corner. Click on it and select Create Custom Field. On the first table that appears, select Calculated Fields.
  3. Since you want to perform calculations on metrics, select Metrics as the category from the Select Category drop-down.
  4. To list all columns, use @ and to list all tables, use #. These prefixes are necessary to resolve the schema of the dataset.
  5. You can select columns and add the necessary calculation, and give a name to that calculation. (Please refer to the screenshot for further guidance).
  6. If you want the calculation to be done on a row-level basis instead of after aggregation, enable the Row Level flag.
  7. Once you have entered the necessary details, validate the calculation by clicking on Validate Expression.
  8. If the validation is successful, save the calculation by clicking on the Save button.
  9. Click on Publish in the SME to make your changes live.
  10. After the publish is successful, you can retrieve the calculation by querying it in Athena. You can also retrieve multiple columns along with it.
  11. Please refer to the attached screenshot for further assistance.