<@U088WCP3B4P> Can I use the Dimension Anomalies T...
# ask-elementary-ai
f
@kapa.ai Can I use the Dimension Anomalies Test with the sum of a column, split by dimensions ?
k
A message from kapa.ai
Based on the knowledge sources, the standard
dimension_anomalies
test in Elementary Data currently only supports monitoring row counts by dimension, not other aggregation functions like sum. However, as of May 2024, Elementary has added a new feature to the
column_anomalies
test that allows you to specify dimensions. This means you can now detect anomalies in column metrics (including sum) split by dimensions. Here's how you can configure it:
Copy code
columns: - name: your_column_name     tests:     - elementary.column_anomalies:         column_anomalies:             - sum         dimensions:             - dimension1             - dimension2
This will calculate the sum of your column for every time bucket and dimension value combination, allowing you to detect anomalies in specific segments of your data. This feature was a highly requested one, as shown in multiple community discussions and GitHub issues, and was finally implemented in the May 2024 update [as noted in the changelog](https://docs.elementary-data.com/changelog#column-anomalies-by-dimensions). Prior to this update, users had to create separate tests with different
where_expression
clauses for each dimension value, which wasn't scalable for dimensions with many values. I hope this helps with your use case!