I’m having trouble calculating a specific metric. Can someone walk me through the steps to solve this problem?
Certainly, @vignesh.sivakumar. You can use the Calculated Metric feature. Here are the steps to create one:
- 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.
- 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.
- Since you want to perform calculations on metrics, select Metrics as the category from the Select Category drop-down.
- To list all columns, use @ and to list all tables, use #. These prefixes are necessary to resolve the schema of the dataset.
- You can select columns and add the necessary calculation, and give a name to that calculation. (Please refer to the screenshot for further guidance).
- If you want the calculation to be done on a row-level basis instead of after aggregation, enable the Row Level flag.
- Once you have entered the necessary details, validate the calculation by clicking on Validate Expression.
- If the validation is successful, save the calculation by clicking on the Save button.
- Click on Publish in the SME to make your changes live.
- After the publish is successful, you can retrieve the calculation by querying it in Athena. You can also retrieve multiple columns along with it.
- Please refer to the attached screenshot for further assistance.