[Analytics Engineering] Calculating Geometric Mean using SQL
Ali, Saqib docbook.xml at gmail.com
Mon Mar 25 13:51:25 UTC 2024
Recently I had to calculate the Geometric Mean of columns in a table using SQL. To calculate the geometric mean, you have to first multiply all values and then take the nth root of that number, where n is the number of values in the column. There is no function in SQL to calculate the Geometric Mean. So I developed a Recursive CTE SQL to accomplish the task. Recursive CTE SQL available on Github: https://qosf.com/calculating-geometric-mean-of-values-in-a-column-using-SQL.html
- Previous message (by thread): [Wranglers] DBT Contracts and model versioning
- Next message (by thread): [Wranglers] Webinar: Designing the Business Vault. Key Strategies for Effective Data Organization