Connect'In Tutorials - Queries

Create a short description or engaging message to motivate your audience to take action

Apply Filters on Tags 

To apply a value filter to a single tag, go to the Queries tab of a panel.

On the tag you would like to apply to filter on, click on "Advanced Options". Enter filters in the "Tag Filter" section. 

queries1

Apply Time Filter on Tags 

To apply a time filter to a single tag, go to the Queries tab of a panel. You may find this useful for things like cycle comparison when you want to isolate data for certain time periods for comparison.

On the tag you would like to apply the filter on, click on "Advanced Options". Enter filters in the "Time Filter" section.

queries2

Data Resampling 

Data resampling is the aggregation of data to a specified frequency. For example, you would like to display daily averages, or monthly averages while the database contains minute or hourly averages.

Data resampling is done automatically by the front end depending on the time range selected (and other factors). However, for some plugins, it may be necessary to have the same timestamps for data points.

On the tag you would like to apply the resampling on, click on "Advanced Options". Specify the resampling frequency (for example, 1d for 1 day, 1h for 1 hour, 2M for 2 months). If there is no value for a specific time range, you can select to have the no value returned (none), a null value, or use the previous value.

queries3

Manual Query Calculations : A+B 

Time to time, you would like to perform a simple calculation on the data in the database. This can be done via the Manual Query.

Important : Manual query relies on the tag name like 'FI001.PV" (not the tag label like "feed flowrate").
You can get the tag names from flowconfig.

To do a simple addition of two tag, Add a new query in the Query tab of a panel. Select "Manual Query" in the "Mode" drop down.

In the text field that appears, enter in the following (Replace TAGNAME1 and TAGNAME2 with real tag names of the unit you're working on).

SELECT MEAN("TAGNAME1") + MEAN("TAGNAME2") FROM "centralized_data" WHERE $timeFilter GROUP BY time(auto) FILL(null)

Alarms are not working with manual query so far. It should be fixed in near future.

queries4

Manual Query Calculations : Cumulative Sum

 Add a new query in the Query tab of a panel. Select "Manual Query" in the "Mode" drop down.

In the text field that appears, enter in the following (Replace TAGNAME1 with real tag name of the unit you're working on).

SELECT Cumulative_Sum(MEAN("TAGNAME1"))FROM "centralized_data" WHERE $timeFilter GROUP BY time(auto) FILL(null)

Important : Manual query relies on the tag name like 'FI001.PV" (not the tag label like "feed flowrate"). You can get the tag names from flowconfig.

queries5