When performing a SQL group (or pseudo-SQL as is the case here) everything 
you select must either be a part of the group by clause or have a grouping 
function applied.  At a guess, I'd say you want the values of E and F 
corresponding to MAX(A), right?  The API's pseudo-SQL doesn't have anything 
that allows you to do this.  You could query your data source without the 
group and then perform the group in js using the API's built in 
Group<https://developers.google.com/chart/interactive/docs/reference#google_visualization_data_group>method.
  You'd have to write a custom aggregator function to get the 
results you want, but that's the only way to do it.

On Tuesday, May 22, 2012 3:27:10 PM UTC-4, Gabe wrote:
>
> I have a similar problem.  I am tracking items(column B) and each item has 
>> multiple locations with a date(A), lat(E), long(F), and description(G) of 
>> that location.  I would like to query the latest location for each item.
>>
> I can query the latest date with  'SELECT B, MAX(A) GROUP BY B', but I 
> don't get the location information with that.  When I try 'SELECT B,E,F 
> MAX(A) GROUP BY B' I get an error telling me I need to either remove E and 
> F from Select, or add them to the Group by.  But when I add them to the 
> Group By, I get multiple locations for each item, so it defeats my query.
>
> Any suggestions on how to retain all my location columns, but only show 
> the most recent location for each item? 
>
>>  
>>
>>

-- 
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/-/6XqydDtXk7QJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to