Creating a dataset by hour for Box and whisker plot

Hello all, I am working in ignition 8.1 with the vision module.
I have a dataset that consists of the last 24 hours worth of data for a single temp tag. So the current dataset is two columns: a time column and the column for all the values.
I want to break up or create a new dataset from that current dataset that will have each hour of the 24 hours in column form so I can them bind that dataset to a box and whisker plot to show each hour on operation throughout the day.
This is the current dataset that I have:

Thank you for any help

Sounds like a job for the view() expression function from my (free) Simulation Aids module. Grouping by hour and pivoting on the hour.

is there anyway to do what I want without installing your module?

Sure. Write jython to process the data. As noted in the documentation, if you get something working with the view() function but need to deploy without it, its debugger can be turned on to show you the jython it used for your case. You could then re-deploy that in a script module and call from a property change event.

1 Like

Hey, Phil,

I'm having trouble grouping by hour.

This simple statement works
select system.date.getHour24(t_stamp) as hour24, system.aggregate.count(high_cap)

but when I add the group by clause,

select system.date.getHour24(t_stamp) as hour24, system.aggregate.count(high_cap)
Group By system.date.getHour24(t_stamp)

I get the following error

image

When grouping, in the SELECT expressions, all of the columns are delivered as python lists. When you use a bare column name, my parser will stick a [0] onto the select expression for you, but once you wrap in some other function, you will have to handle it yourself (if the function doesn't take lists).

So, you should use:

SELECT system.date.getHour24(t_stamp[0]) As hour24, system.aggregate.count(high_cap)
GROUP BY system.date.getHour24(t_stamp)