Is it possible to access history data from the scripts?

Hi!

Is it possible to access history data in tags from scripts? This to create calculations such as aggregations (e.g. previous day average production rate) that run on a periodic basis

Thanks
Abel