This is an old revision of the document!


AddQuery

This is a function of the LagCorrectedQuery class.

Description

This adds an AQL query that should be run when you Execute the finished request.

Parameters

ParameterTypeMeaning
querystringThe AQL query to run
lagfloatThe amount of lag to apply to this query

Returns

Nothing

Usage

You normally add a single query for each different level of lag in your system.

For example, Machine A is 100m away, so you query all of the points for that machine in a query with lag set to 100.

Machine B is 50m away, so you add a query for that machine with a lag of 50.

Machine C is at the end of the line - you don't add a lag at all.

Since you usually build these queries backwards, there's often either no lag or only a small amount of lag from the end asset found at the end of your process line.

Choosing a Lag

The lag you choose for each query should be the distance between that asset and your end asset.