pgzmnk commited on
Commit
0db7015
1 Parent(s): 8598d1e

Round sql VALUE calculation.

Browse files
Files changed (1) hide show
  1. utils/duckdb_queries.py +1 -1
utils/duckdb_queries.py CHANGED
@@ -55,7 +55,7 @@ def check_if_project_exists_for_year(project_name, year):
55
 
56
  def write_score_to_temptable(df):
57
  con.sql(
58
- "CREATE OR REPLACE TABLE _temptable AS SELECT *, (value * area) AS score FROM (SELECT year, project_name, AVG(value) AS value, area FROM df GROUP BY year, project_name, area ORDER BY project_name)"
59
  )
60
  return True
61
 
 
55
 
56
  def write_score_to_temptable(df):
57
  con.sql(
58
+ "CREATE OR REPLACE TABLE _temptable AS SELECT *, ROUND((value * area), 2) AS score FROM (SELECT year, project_name, ROUND(AVG(value), 2) AS value, area FROM df GROUP BY year, project_name, area ORDER BY project_name)"
59
  )
60
  return True
61