Hi everyone, I'm wondering if the `timestamp_colu...
# community-support
a
Hi everyone, I'm wondering if the
timestamp_column
and the
freshness_anomalies
only work for the data that's within the table. That is, do you need to have two rows with different timestamps for the
freshness_anomalies
to kick in? In the documentation it says the following:
Copy code
When you specify a timestamp_column, when the test runs it splits the data to buckets according to the timestamp in this column, calculates the metric for each bucket and checks for anomalies between these buckets. This also means that if the table has enough historical data, the test can start working right away.
Does this mean
freshness_anomalies
doesn't work if you truncate and load the data? My goal is to detect when the data is more than X days old based on a
timestamp_column
👀 1
l
hi @Andres Crucetta, I've been there too 😕 unfortunately I figure out that freshness_anomalies is calculated as the seconds passed between two consecutive values of the timestamp column, so, yes, the data that's within the table
a
Ohhh thank you for letting me know, were you able to find an alternative?
l
not yet 🥲
j
Hi @Andres Crucetta, interesting use case! If I understand your question correctly you are loading data in a new table and want to make sure the data is not more than x days old? You can have a look at the test-hub. There might be tests that can help you, otherwise you can also write a custom test. This one might do the trick but only if I understood your question correctly: https://www.elementary-data.com/dbt-tests/expect-row-values-to-have-recent-data
✅ 1