Queries between multiple google spreadsheet worksheets

1,753 views
Skip to first unread message

Narin

unread,
Feb 3, 2010, 4:21:51 PM2/3/10
to Google Visualization API
Hello!

I'm building bar charts and data tables using a Google spreadsheet
that has multiple worksheets.

Is it possible to query data between multiple sheets that have the
same columns? For example, a query that shows rows 1 and 2 of Sheet
1, and rows 4 and 5 of Sheet 2?

Thanks in advance for any help!

-Narin

ChartMan

unread,
Feb 4, 2010, 2:58:21 AM2/4/10
to google-visua...@googlegroups.com
you cannot specify that in a single query but you can issue two queries and then join the results in the client.

ChartMan


--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.


Narin

unread,
Feb 15, 2010, 12:25:27 AM2/15/10
to Google Visualization API
Thanks for the tip. I've successfully joined 2 tables, but I need to
join a third. I've tried creating a join, then joining that table
with a third, but it is not working. Here is my code. Any tips would
be appreciated!

var joined_dt = google.visualization.data.join(data1, data2,
'full', [[1,1],[2,2],[5,5],[6,6],[7,7],[8,8]], []);
var joined_dt2 = google.visualization.data.join(joined_dt,
data3, 'full', [[1,1],[2,2],[5,5],[6,6],[7,7],[8,8]], []);

The problem seems to be coming from the 2nd line because if I comment
it out, my script runs fine.

On Feb 4, 2:58 am, ChartMan <chart...@google.com> wrote:
> you cannot specify that in a single query but you can issue two queries and
> then join the results in the client.
>
> ChartMan
>

> On Wed, Feb 3, 2010 at 11:21 PM, Narin <n.rat...@gmail.com> wrote:
> > Hello!
>
> > I'm building bar charts and data tables using a Google spreadsheet
> > that has multiple worksheets.
>
> > Is it possible to query data between multiple sheets that have the
> > same columns?  For example, a query that shows rows 1 and 2 of Sheet
> > 1, and rows 4 and 5 of Sheet 2?
>
> > Thanks in advance for any help!
>
> > -Narin
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Visualization API" group.
> > To post to this group, send email to
> > google-visua...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > google-visualizati...@googlegroups.com<google-visualization-api%2Bunsu...@googlegroups.com>

Viz Kid

unread,
Feb 15, 2010, 7:50:03 AM2/15/10
to google-visua...@googlegroups.com

Hi.

First, it seems you are missing one parameter in the call to the join function. Please see its documentation here:

Second, after the first join, the new joined table has only 6 columns (ordered from 0 to 5).
So when calling to the second join, the keys should probably be
[[0,1],[1,2],[2,5],[3,6],[4,7],[5,8]]

If you still having problems, please let us know.

Best,
  Viz Kid

To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages