How can I run a query on a data table?

75 views
Skip to first unread message

pvenka...@machinezone.com

unread,
Aug 20, 2015, 8:20:42 PM8/20/15
to Google Visualization API
Hi, 
I have some data in a CSV file, which I then read into a dataTable. I want to run a group-by query on the contents of this CSV, which I then want to draw charts on. 

How can I run queries on a data table? Every reference to queries I see seems to imply that queries are only for reading from spreadsheets, and not for running on any local data source. What's the best way to work around this? 

Best, 
priya. 

Daniel LaLiberte

unread,
Aug 20, 2015, 10:15:49 PM8/20/15
to Google Visualization API
Hi Priya,

You should look into the DataView class, which lets you construct another object from an instance of a DataTable by specifying how to filter and sort the rows or select columns or construct new columns.  See https://developers.google.com/chart/interactive/docs/reference#DataView

Also the group and join methods let you do some database-like operations on data tables.  See https://developers.google.com/chart/interactive/docs/reference#data-manipulation-methods



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/331e7156-6ca1-406e-a79f-65690bda0938%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA
Reply all
Reply to author
Forward
0 new messages