query multiple sheets in same spreadsheet

880 views
Skip to first unread message

Peter Wraae Marino

unread,
Apr 22, 2011, 12:09:10 PM4/22/11
to google-visua...@googlegroups.com
What is the technique used to query multiple sheets within the same spreadsheet.

var query1 = new google.visualization.Query( <mySpreadsheet> ); 
query1.send( handleQuery1 );

var query2 = new google.visualization.Query( <mySpreadsheet> ); 
query2.send( handleQuery2 );

I would like to build a custom datatable from the response from query1 and query2, so how should I go about handling this?
I ask because the two handles will be called at different times.

Peter

Pegasusrjf

unread,
Apr 25, 2011, 8:00:13 AM4/25/11
to Google Visualization API
Can you give me a better idea of what you are trying to do?

You can query both separately, by using the sheet ID (gid=#) in the
URL of the query declaration.

On Apr 22, 12:09 pm, Peter Wraae Marino <marino.pe...@gmail.com>
wrote:

Peter Wraae Marino

unread,
Apr 25, 2011, 8:04:17 AM4/25/11
to google-visua...@googlegroups.com
hi,

actually I can show you my solution:


the data comes from many sheets and is calculated using some javascript code to create a new table
and display a graph.

I would have liked to avoid having to code all this javascript code and do somekind of query and get the same result.

but basically what I did is I did s send query for all the sheets and when I received the response I kept track that the query was
done. When all sheets have returned a response I then processed a combined datatable.

but the fact is keeping track of when a sheet was completed was a little tricky. Se the html code for how I did it.

regards,
Peter

--
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.

Jinji

unread,
Apr 26, 2011, 11:39:20 AM4/26/11
to google-visua...@googlegroups.com
On Mon, Apr 25, 2011 at 3:00 PM, Pegasusrjf <pegas...@gmail.com> wrote:
Can you give me a better idea of what you are trying to do?

You can query both separately, by using the sheet ID (gid=#) in the
URL of the query declaration.

or use the sheet=<name> URL parameter, if you prefer to refer to sheets by their names and not by their ID.
 

On Apr 22, 12:09 pm, Peter Wraae Marino <marino.pe...@gmail.com>
wrote:
> What is the technique used to query multiple sheets within the same
> spreadsheet.
>
> var query1 = new google.visualization.Query( <mySpreadsheet> );
> query1.send( handleQuery1 );
>
> var query2 = new google.visualization.Query( <mySpreadsheet> );
> query2.send( handleQuery2 );
>
> I would like to build a custom datatable from the response from query1 and
> query2, so how should I go about handling this?
> I ask because the two handles will be called at different times.
>
> Peter
> --
> Bellinge Gymnasterne:http://www.bellingegymnasterne.dk
> Power Tumbling:http://www.powertumbling.dk
> OSG-Help:http://code.google.com/p/sigmaosg
> Personal Site:http://www.marino.dk

Reply all
Reply to author
Forward
0 new messages