I want to group data by tripid and find the max value of a field within this group

I am performing this SQL command
SELECT MAX(DistanceTravel) as MaxTripDist, TripId FROM table.StatusMessage group by TripId;

Is there a way to show the max distance in a horizontal bar chart with the tripid as the x-axis and hte max distance on the y-axis?

You can do that type of chart with Lens but using the graphical interface to aggregate by that filter and then get the maximum value of that other field.

On the following screenshot, using the Kibana Flights sample dataset, I group documents by the top values of the Carrier field and then get the maximum value of the AvgTicketPrice field.