You should look at all the functions that are available for the stats command and use what you need, You will probably need values , avg , last , min , and max . You just string them along like this:
source=myapp test123 | stats count avg(delay) last(status) values(color) by type
If you are gong to graph them, you should switch from stats to chart , which is a very similar command and it automatically advances populates the Visualization tab.
http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/CommonStatsFunctions
... View more