               SUM(num_commitments) as total_num,
               SUM(to_number(sum_amount_usd_constant, 'FM99999999999999999999')) as total_amount
             from donor_recipient_year_purpose_ma 
-            where purpose_code is not null
+            
             group by purpose_code, purpose_name
             order by purpose_name
           ",

    _.values(unique)


  @get '/aiddata-purposes.csv': ->
    pg.sql "select distinct(purpose_code) as code,purpose_name as name
              from donor_recipient_year_purpose_ma 




  # Returns a list of the purposes used in the database (including NULLS)
  # along with the total amounts and numbers of commitments
  @get '/aiddata-purposes-with-totals.csv': ->
    pg.sql "select
              purpose_code as code,
