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.

This normally translates into having a distinct query for each asset - but there may be times when some assets are part of the same system and share the same amount of lag.

For example, Machine D is at the end of the line - we add a query for the properties on that asset, but it doesn't need any value for lag.

Machine C is 50m away, so we create a query specifically for it with a lag of 50.

Machine A and Machine B are 100m away, so you query all of the points for both of those machines in a single query, with lag set to 100.

Choosing a Lag

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. Your lag value increases as you get close to the 'start' of the process.

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