Thanks for all the help I’ve gotten already by browsing the forum, but I couldn’t find an answer to this one:
Is there a way to run a query or otherwise access the data in a dataset that is displayed in a table?
I have a table which runs a query to display Cycle times for the operator, and I would like to also display some statistics regarding the data on that table, Average, Max / Min etc.
I could have another query against the database using the same parameters but returning the average or Min / Max, but it would seem to be more efficient to not require another query against the db.
If your requirements are simple, you could just use the expression functions in the ‘Aggregates’ section to access the ‘data’ property of the table. The most common operations are supported. You might want to start here.
Hi tdornbrush,
Your question was part of the inspiration for the view() expression function in the beta Simulation Aids module. You might want to take a look at it. In this particular case, a “Group By 0” clause would allow you to apply aggregate functions to all of the source rows in your table.
I haven’t taken a look at the Simulation Aids yet, but I used Phil’s suggestion of expression bindings and it worked well.
I made a table of averages (a single row) below my main table. I added custom properties to the ave table, one for each column, and used the expression “mean({dataset},col)” to bind them to columns in my main table.
Then I bound the newly populated custom properties to my ave table’s cells using cell update bindings.