Slope retrieval - wwExpression query example
- Last UpdatedFeb 06, 2025
- 1 minute read
The following query calculates and returns the rate of change of the Distance tag. The results are returned in the tag's default unit of measure, which in this case is feet/second.
SELECT DateTime, TagName, Value, QualityDetail, wwUnit FROM History
WHERE TagName = 'Distance'
AND wwRetrievalMode = 'Slope'
The results are:
|
DateTime |
TagName |
Value |
QualityDetail |
wwUnit |
|---|---|---|---|---|
|
2020-07-29 06:50:53.748 |
Distance |
1 |
192 |
ft/s |
|
2020-07-29 06:50:54.748 |
Distance |
2 |
192 |
ft/s |
To display the results using a different unit of measure, you can use the wwExpression query parameter with the following syntax:
wwExpression = 'UOM(TagName, target unit)'
For example, the following query calculates and returns the rate of change of the Distance tag in meters/second.
SELECT DateTime, TagName, Value, QualityDetail, wwUnit FROM History
WHERE TagName = 'Distance'
AND wwExpression = 'UOM(Distance, m/s)'
AND wwRetrievalMode = 'Slope'
The results are:
|
DateTime |
TagName |
Value |
QualityDetail |
wwUnit |
|---|---|---|---|---|
|
2020-07-29 06:50:53.748 |
Distance |
0.3048 |
192 |
m/s |
|
2020-07-29 06:50:54.748 |
Distance |
0.6096 |
192 |
m/s |
Note: Engineering unit conversion requires the advanced feature license. If your Historian does not have the advanced feature license activated, the results are returned in the original units.