I have some Boolean and string variables that I want to display in the info window on carto db. But it seems to be only showing one individual data point. How do I get it to show modes or averages of the entire data set?


You need to add some SQL to make that information available. If you open the SQL tray and change SELECT * FROM your_table to:

SELECT *, avg(interesting_column) OVER () AS table_avg
FROM your_table

Now toggle the new variable on in your infowindow to make it available. Just fill in interest_column with the numeric column you want information from, and make sure to update your_table with the appropriate name.

  • 1
    The SQL trick mentioned here is called a Window Function and you can get more details about them here. They are really useful!! – Jorge Sanz Jun 13 '16 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.