SQL Query for vulnerabilities over X days since discovery

So the reporting data model and the data warehouse actually have some differences between their schemas. In this case, I believe the fact_asset_vulnerability_age table is available in the reporting data model, but not the data warehouse.

If you’re looking to filter for vulnerabilities that are over 90 days old, you should be able to use the “date” field from the fact_asset_vulnerability_finding that you mentioned. It would mean using some Postgres functions to go from that date → exact age, but this post provides a good example of how to do that. It would likely end up looking like this:

ROUND(age(favf.date, 'days'))::integer

The post I linked explains what each of the functions used above is actually doing. Hopefully that gets you the 90 day filter you’re looking for.