Create a chart using multiple datasets or nested datasets

I will give some background on the task I have at hand, and the way that I have to go about it, given the way our system is set up and where all our data is stored.

What we have are multiple CNC machines that regularly send data to a database with statistics about their running and what they are doing. The machines log a record each time they finish a part, and the times may not all be the same between machines.

Each machine updates a table of its own every time a part is finished, so for the Bore Gage measurement of Machine number 1, the update to the database will happen in the table BoreGage_00001 and machine 2 will update BoreGage_00002 and so forth.

There are multiple ‘jobs’ running on different machines, and these are logged along with everything else.

I have been tasked to make, using Ignition, a chart that displays data points on a given date range for each type of log, for each machine, for each job. I have it working perfectly for the cases where I have a specific log type, on one single machine (so pulling from one single table into a single dataset), for all jobs. It also works in that same scenario searching for a single job on a single machine. (these are all over a date range)

The thing I cannot figure out is how to take multiple data sets (gathered by finding a single job running on multiple machines, so pulling from multiple tables into multiple data sets) and displaying them in the chart. I can bring the different Pydatasets together into a Pydataset of Pydatasets…but when attempting to make it into a regular dataset I get an error saying it cannot be coerced.

Furthermore, a larger question I would have would be: is there a way to append datasets on the graph as I get them? I’m still rather new to Ignition so please excuse me if I’m asking a stupid question. I have included a chart of the type that I am trying to build dynamically.

Also I apologize for the size of the example chart, I thought I’d be able to scale it here.


Unless I read something wrong, I would think you would be a lot better off joining your data from the different databases in a SQL query before you even go to Ignition with it. I would assume you have a job number or something similar in each record of each database table that are the same for each job. You could use joins in the query based on that job number to gather all the data into one SQL dataset which you would use in Ignition for the charting.

Thank you so much for your help, RRRancher. I did change my queries but it didn’t give me the result I wanted. I determined from a superior that there would only ever be 4 machines or less running a job at a given time, so I used multiple charts that are hidden unless there is something to be displayed on them, which works for this occasion, and that is all my team leader cares about haha.

Thanks for your help!