Those two queries can be combined into a single query.  You can then use 
DataViews to separate them out into two separate data sets.  The combined 
query would look something like this:

SELECT b.id_respuesta , COUNT(b.id_respuesta) AS cnt, b.id_aspecto
FROM huesped a, rompe_encuesta b
WHERE
b.id_huesped = a.id_huesped AND
((b.id_aspecto = 1 AND b.id_respuesta >= 8 AND b.id_respuesta <= 11) OR 
(b.id_aspecto = 2 AND b.id_respuesta >= 12 AND b.id_respuesta <= 15)) AND
a.fecha BETWEEN '$var1' AND '$var2'
GROUP BY b.id_respuesta;

This will give you a data set with 3 columns; the third column is what you 
will use to distinguish between the data sets.  Add another column to the 
data table, of type "number" (you can call it anything you like).  Populate 
the new column with the "id_aspecto" data.  When you have that set up, we 
can fix your javascript to use the new data.

On Thursday, December 13, 2012 1:37:33 AM UTC-5, Chrystopher Medina wrote:
>
>
> this was what i had. this is the query that u help me to do it .
> $query = "SELECT b.id_respuesta , COUNT(b.id_respuesta) AS cnt
> FROM huesped a, rompe_encuesta b
>  WHERE
> b.id_huesped = a.id_huesped AND
> b.id_aspecto = 1 AND
>  b.id_respuesta >= 8 AND //u remember that 8=word of mouth recomendation 
> and 9=magazine advertisement etc b.id_respuesta <= 11 AND
>  a.fecha BETWEEN '$var1' AND '$var2'
> GROUP BY b.id_respuesta;";
>
> and the second query is this .....is practycaly the same:  I just change 
> the aspect to evaluate
>
> $query = "SELECT b.id_respuesta , COUNT(b.id_respuesta) AS cnt
> FROM huesped a, rompe_encuesta b
>  WHERE
> b.id_huesped = a.id_huesped AND
> b.id_aspecto = 2 AND  //here 
>  b.id_respuesta >= 12 AND //here 12=excelent 13=goog 14=fair 15=poor
> b.id_respuesta <= 15 AND
>  a.fecha BETWEEN '$var1' AND '$var2'
> GROUP BY b.id_respuesta;";
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/Ho2MCH4NV1EJ.
To post to this group, send email to google-visualization-api@googlegroups.com.
To unsubscribe from this group, send email to 
google-visualization-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to