1

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?

1 Answer 1

1

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
  • 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
    Commented Jun 13, 2016 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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