Querying Data in a Report

To query data, the mplreport class has the FetchHistory function.

The function takes a single parameter - the AQL function you want to run. Note that this function should not include the call to GETHISTORY. The API will take care of adding that for you. You simply need to include a query that returns a list of ARDI points.

For example, if we wanted to make a report showing every temperature measurement in our system, we could do the following…

   thedata = report.FetchHistory("'Temperature' PROPERTYEX ALLPOINTS")

The thedata variable would now contain a AQLHistResponse object. This object contains both the metadata for your query (describing the individual points), and a pandas dataframe containing your data.

NOTE: If you're following along with your own ARDI databases, we suggest substituting 'Temperature' for a value that exists in your ARDI system.

Next, we'd like to use our historical data in our report.