SQL Report question - breaking data into batches or cycles

Hello All,

I , like many control programmers who are well versed in the glory of Ladders code and PLC programming have a bit of a learning curve to the SQL query methodology.

While creating reports using continuous data trends is somewhat straight forward I am at a loss as to how to break these trends down into individual "Batches" or "Cycles. While the triggered data settings in the Transaction groups makes quick work of focusing the data into segmented "groups" how does one set-up up a report to find and populate a report based on these "chunks" of data?

You generally need another query that supplies the boundaries between chunks as timestamps, then you can configure a nested query to get the data per chunk. You could then use an "unstructured" detail row of a table to hold the chart. Or use an outer table group for more options.

Phil,
Again. I am relatively new to SQL . Are you saying make a nested query that defines the "START" and "STOP" points and a second to pull process data?

Yes, two queries. The outer query constructs one row per chunk with start and stop timestamps (and captures whatever other meta-data about the chunk that you want to show in the table). The inner query uses the outer row's timestamps to query the process data within those bounds.

Then a table in the report can show the values from the outer query's columns directly, and a chart embedded in the unstructured row can reference the inner query's data key.

Phil,

Is there any "examples" to this approach. Like I said, I am in the SQL learning process.
Just something that demonstrates the structure.

Thanks for your help.

Right in the manual, with links to IU videos:

Note in particular how the SQL for the "Frequency" nested query uses a parameter supplied by each row of the "Codes" query.

And: