Datafable / rolling-blackout-belgium

Rolling blackout plan in Belgium
http://datafable.github.io/rolling-blackout-belgium/viz/
Other
18 stars 12 forks source link

Cannot create percentage columns in CartoDB #10

Closed peterdesmet closed 9 years ago

peterdesmet commented 9 years ago

I'm stumped. For some reason, CartoDB let's me create percentage columns as such:

SELECT
*,
round((section_1/total*100)::numeric,2) as section_1_pct
FROM municipalities_blackout

But nothing happens if I select that column in the choropleth wizard. If I try to export the data, it's all empty. If I try to create a table of the view, I get a 8003 error, warning me about duplicate columns.

peterdesmet commented 9 years ago

Total can be zero, which would divide by zero. CartoDB does show the column, but all the rest doesn't work. Can be solved with a CASE.